config¶
ColorConfig
dataclass
¶
Config
dataclass
¶
arc's Config object. A single global instance of this class is created, then used where it is needed
Source code in /home/runner/work/arc/arc/arc/config.py
LinksConfig
dataclass
¶
PluginConfig
dataclass
¶
Configures Plugins locations for the application
Source code in /home/runner/work/arc/arc/arc/config.py
entrypoints: list[str] = field(default_factory=list)
class-attribute
instance-attribute
¶
List of explicit entrypoints to search for plugins. The entrypoint's value must be
a callable that accepts a single argument, the Context
object.
groups: list[str] = field(default_factory=lambda : ['arc.plugins'])
class-attribute
instance-attribute
¶
List of entrypoint groups to search for plugins. The entrypoint's value must be
a callable that accepts a single argument, the Context
object.
Defaults to using the arc.plugins
entrypoint group
paths: list[str] = field(default_factory=list)
class-attribute
instance-attribute
¶
List of paths to search for plugins. These paths will be searched
for python modules that contain a plugin
function. If the file does
not exist, or the function is not found, it will be ignored
The paths provided can be to a specific file, or a directory. If a directory is provided, all files in that directory will be searched for plugins.
PresentConfig
dataclass
¶
Configures the presentation of the application
Source code in /home/runner/work/arc/arc/arc/config.py
color: ColorConfig = field(default_factory=ColorConfig)
class-attribute
instance-attribute
¶
The color configuration for the application
formatter: type[HelpFormatter] = DefaultHelpFormatter
class-attribute
instance-attribute
¶
Class to use when formatting help messages
indent: str = ' ' * 4
class-attribute
instance-attribute
¶
The indent to use for each level of indentation
width: int = 80
class-attribute
instance-attribute
¶
The default width to present content at. This is used for wrapping text. Will be ignored if the terminal width is smaller
SuggestionConfig
dataclass
¶
configure(*, version=None, environment=None, transform_snake_case=None, suggest=None, env_prefix=None, config_env_prefix=None, load_env=None, prompt=None, autocomplete=None, allow_unrecognized_args=None, debug=None, links=None, present=None, plugins=None, **kwargs)
¶
Function for updating global arc
configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
version |
str | SemVer
|
Version string to display with |
None
|
environment |
str
|
The current environment, either |
None
|
transform_snake_case |
bool
|
Transform |
None
|
env_prefix |
str
|
A prefix to use when selecting values for parameters from enviroment variables. Will be combined with the name specified by parameter. |
None
|
config_env_prefix |
str
|
A prefix to use when selecting values from enviroment for the configuration. |
None
|
load_env |
bool
|
Enable / disable loading config values from environment variables.
Currently, arc can only load |
None
|
prompt |
Prompt
|
A prompt object will be used when prompting
for parameter values. Is also made available via |
None
|
autocomplete |
bool
|
Enable / disable command line completions for this app. Currently
the default is |
None
|
allow_unrecognized_args |
bool
|
arc will not error when there are arguments provided
that arc does not recognize. Their values will be stored in the context under the
key |
None
|
debug |
bool
|
enable / disable arc debug logs. |
None
|
present |
PresentConfig
|
set the presentation configuration for arc |
None
|
suggest |
SuggestConfig
|
configure the settings for suggesting replacements when arc does not recognize a command / parameter |
None
|
links |
LinksConfig
|
configure the links that arc may use in some output |
None
|
Source code in /home/runner/work/arc/arc/arc/config.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
|