Let us walk on the 3-isogeny graph
|
Public Member Functions | |
None | __init__ (self, bool isolated, Optional[Kind] load_only=None) |
None | load (self) |
Optional[str] | get_file_to_edit (self) |
Iterable[Tuple[str, Any]] | items (self) |
Any | get_value (self, str key) |
None | set_value (self, str key, Any value) |
None | unset_value (self, str key) |
None | save (self) |
Iterable[Tuple[str, str]] | get_environ_vars (self) |
Iterable[Tuple[Kind, List[str]]] | iter_config_files (self) |
Dict[str, Any] | get_values_in_config (self, Kind variant) |
str | __repr__ (self) |
Data Fields | |
isolated | |
load_only | |
Protected Member Functions | |
None | _ensure_have_load_only (self) |
Dict[str, Any] | _dictionary (self) |
None | _load_config_files (self) |
RawConfigParser | _load_file (self, Kind variant, str fname) |
RawConfigParser | _construct_parser (self, str fname) |
None | _load_environment_vars (self) |
Dict[str, Any] | _normalized_keys (self, str section, Iterable[Tuple[str, Any]] items) |
Tuple[str, RawConfigParser] | _get_parser_to_modify (self) |
None | _mark_as_modified (self, str fname, RawConfigParser parser) |
Handles management of configuration. Provides an interface to accessing and managing configuration files. This class converts provides an API that takes "section.key-name" style keys and stores the value associated with it as "key-name" under the section "section". This allows for a clean interface wherein the both the section and the key-name are preserved in an easy to manage form in the configuration files and the data stored is also nice.
Definition at line 87 of file configuration.py.
Definition at line 101 of file configuration.py.
References Configuration.__init__(), and i.
Referenced by Configuration.__init__(), and Protocol.__init_subclass__().
str __repr__ | ( | self | ) |
Definition at line 380 of file configuration.py.
|
protected |
Definition at line 277 of file configuration.py.
References i.
Referenced by Configuration._load_file().
|
protected |
A dictionary representing the loaded configuration.
Definition at line 233 of file configuration.py.
References i.
Referenced by Configuration.get_value(), and Configuration.items().
|
protected |
Definition at line 227 of file configuration.py.
References i, and Configuration.load_only.
Referenced by Configuration.save(), Configuration.set_value(), and Configuration.unset_value().
|
protected |
Definition at line 361 of file configuration.py.
References Configuration.load_only.
Referenced by Configuration.get_file_to_edit(), Configuration.set_value(), and Configuration.unset_value().
|
protected |
Loads configuration from configuration files
Definition at line 244 of file configuration.py.
References Configuration._load_file(), i, Configuration.iter_config_files(), and Configuration.load_only.
Referenced by Configuration.load().
|
protected |
Loads configuration from environment variables
Definition at line 298 of file configuration.py.
References Configuration._normalized_keys(), Configuration.get_environ_vars(), and i.
Referenced by Configuration.load().
|
protected |
Definition at line 267 of file configuration.py.
References Configuration._construct_parser(), Configuration._normalized_keys(), and i.
Referenced by Configuration._load_config_files().
|
protected |
Definition at line 375 of file configuration.py.
Referenced by Configuration.set_value(), and Configuration.unset_value().
|
protected |
Normalizes items to construct a dictionary with normalized keys. This routine is where the names become keys and are made the same regardless of source - configuration files or environment.
Definition at line 304 of file configuration.py.
References pip._internal.configuration._normalize_name().
Referenced by Configuration._load_environment_vars(), and Configuration._load_file().
Iterable[Tuple[str, str]] get_environ_vars | ( | self | ) |
Returns a generator with all environmental vars with prefix PIP_
Definition at line 318 of file configuration.py.
References i.
Referenced by Configuration._load_environment_vars().
Optional[str] get_file_to_edit | ( | self | ) |
Returns the file with highest priority in configuration
Definition at line 128 of file configuration.py.
References Configuration._get_parser_to_modify(), and Configuration.load_only.
Any get_value | ( | self, | |
str | key | ||
) |
Get a value from the configuration.
Definition at line 143 of file configuration.py.
References Configuration._dictionary(), pip._internal.configuration._disassemble_key(), and pip._internal.configuration._normalize_name().
Dict[str, Any] get_values_in_config | ( | self, | |
Kind | variant | ||
) |
Get values present in a config file
Definition at line 357 of file configuration.py.
Iterable[Tuple[str, Any]] items | ( | self | ) |
Returns key-value pairs like dict.items() representing the loaded configuration
Definition at line 137 of file configuration.py.
References Configuration._dictionary(), and Configuration.items().
Referenced by OrderedDict.__eq__(), CaseInsensitiveDict.__repr__(), OrderedDict.__repr__(), ParseResults.as_dict(), ParseResults.dump(), and Configuration.items().
Iterable[Tuple[Kind, List[str]]] iter_config_files | ( | self | ) |
Yields variant and configuration files associated with it. This should be treated like items of a dictionary.
Definition at line 327 of file configuration.py.
References pip._internal.configuration.get_configuration_files(), i, Configuration.isolated, and InstallRequirement.isolated.
Referenced by Configuration._load_config_files().
None load | ( | self | ) |
Loads configuration from configuration files and environment
Definition at line 122 of file configuration.py.
References Configuration._load_config_files(), Configuration._load_environment_vars(), Configuration.isolated, and InstallRequirement.isolated.
None save | ( | self | ) |
Save the current in-memory state.
Definition at line 203 of file configuration.py.
References Configuration._ensure_have_load_only(), and i.
Referenced by pyparsing_test.reset_pyparsing_context.__enter__().
None set_value | ( | self, | |
str | key, | ||
Any | value | ||
) |
Modify a value in the configuration.
Definition at line 155 of file configuration.py.
References pip._internal.configuration._disassemble_key(), Configuration._ensure_have_load_only(), Configuration._get_parser_to_modify(), Configuration._mark_as_modified(), pip._internal.configuration._normalize_name(), i, and Configuration.load_only.
None unset_value | ( | self, | |
str | key | ||
) |
Unset a value in the configuration.
Definition at line 174 of file configuration.py.
References pip._internal.configuration._disassemble_key(), Configuration._ensure_have_load_only(), Configuration._get_parser_to_modify(), Configuration._mark_as_modified(), pip._internal.configuration._normalize_name(), i, and Configuration.load_only.
isolated |
Definition at line 110 of file configuration.py.
Referenced by InstallRequirement.install(), Configuration.iter_config_files(), and Configuration.load().
load_only |
Definition at line 111 of file configuration.py.
Referenced by Configuration._ensure_have_load_only(), Configuration._get_parser_to_modify(), Configuration._load_config_files(), Configuration.get_file_to_edit(), Configuration.set_value(), and Configuration.unset_value().