Utility functions and classes for .ini style configuration files.
Project description
Utility functions and classes for .ini style configuration files.
Latest release 20220430: New HasConfigIni mixin for classes keeping some configuration in a .ini config file section.
Class ConfigSectionWatcher(collections.abc.Mapping, collections.abc.Collection, collections.abc.Sized, collections.abc.Iterable, collections.abc.Container)
A class for monitoring a particular clause in a config file.
Method ConfigSectionWatcher.__init__(self, config, section, defaults=None):
Initialise a ConfigSectionWatcher to monitor a particular section
of a config file.
config: path of config file or ConfigWatcher
section: the section to watch
defaults: the defaults section to use, default 'DEFAULT'
Class ConfigWatcher(collections.abc.Mapping, collections.abc.Collection, collections.abc.Sized, collections.abc.Iterable, collections.abc.Container)
A monitor for a windows style .ini file.
The current SafeConfigParser object is presented as the .config property.
Class HasConfigIni
Class for objects with a config.ini file.
A section of the config is designated "our" configuration
and its fields parsed into a TagSet;
in particular the field values use the TagSet transcription syntax.
The default implementation is expected to be mixed into a
class with a .pathto(rpath) method, such as one which
inherits from HasFSPath.
The mixin provides the following attributes:
config: an on demand property which is aTagSetmade from the configuration file sectionconfig_ini: the relative path to the configuration fileconfigpath: the full pathname of the configuration fileconfig_flush(): update the configuration file if the tags have been modified
Method HasConfigIni.__init__(self, section, config_ini=None):
Initialise the configuration.
Function load_config(config_path, parser=None)
Load a configuration from the named config_path.
If parser is missing or None, use SafeConfigParser (just
ConfigParser in Python 3).
Return the parser.
Release Log
Release 20220430: New HasConfigIni mixin for classes keeping some configuration in a .ini config file section.
Release 20210306: Fix imports from collections.abc.
Release 20190101: Internal changes.
Release 20160828: Update metadata with "install_requires" instead of "requires".
Release 20150118: Initial PyPI release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cs.configutils-20220430.tar.gz.
File metadata
- Download URL: cs.configutils-20220430.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
216a83a35bd30b6fd0128d809de4907bce7c6aa8153b8b3bfacd95f45a42c6fb
|
|
| MD5 |
e5d7e69590d8a83dc602a7e4c9d5f6e2
|
|
| BLAKE2b-256 |
abbacbec956681da30d0b11c1cb92da6240e5ff2465a2770d10cc7b95881a824
|
File details
Details for the file cs.configutils-20220430-py3-none-any.whl.
File metadata
- Download URL: cs.configutils-20220430-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.1 readme-renderer/30.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.3.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e957f53bdfdc5a46453fbf6af999b491e1e2a98ce33a058c20e34003bbfd20fa
|
|
| MD5 |
2b50d2b34c4e6d304fbdfaf9f7412024
|
|
| BLAKE2b-256 |
462cc623fcec8fc64f52b5a6f667bb180df8807dbbfdf8f72d7f5dc47b402a44
|