Provide reuse to ConfigParser files.
Project description
config-enhance
config-enhance adds re-use capabilities to ConfigParser style config files.
It introduces a reserved key: ‘<<=’
The ‘<<=’ key should be assigned a list of enhancements like:
[section]
<<=
<other1
+other2
<other3
-other4
Each enhancement is composed of an operator followed by a section name. The operators are:
‘<’ : mix things in from another section if they don’t already exist
‘+’ : pull config from another section, overwrite settings in the current section if there is a clash.
‘-’ : remove config items that exist in the source section from this section
You can use it like this:
from config_enhance import enhance
cp = ConfigParser (file ("my.cfg"))
enhance(cp)
Suppose that my.cfg contains content like:
[common]
flup = 1.0
requests = 2.0
[tes_100]
<<= <common
requests = 5.0
tornado = 6.0
[dev_tes_common]
tornado = 6.0d
[dev_unpin]
flup = unpin
[dev_tes_100]
<<=
<tes_100
+dev_tes_common
-dev_unpin
After running enhance, ‘cp’ will be modified to contain:
[common] flup = 1.0 requests = 2.0 [tes_100] flup = 1.0 requests = 5.0 tornado = 6.0 [dev_tes_common] tornado = 6.0d [dev_unpin] flup = unpin [dev_tes_100] requests = 5.0 tornado = 6.0d
target audience
config-enhance is useful when managing version requirement sections in buildout. Buildout already contains limited reuse features through the ‘<=’ idiom. But, version management is easier with an extended set.
Other docs of interest
Project details
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 config-enhance-1.2.2.tar.gz.
File metadata
- Download URL: config-enhance-1.2.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b6efe72209dc310f7e221963f0eb12a71f9ab3e56524b1249024fc13a6ca7ad
|
|
| MD5 |
4db9523b0fc9564c8b9b8fdb0079a357
|
|
| BLAKE2b-256 |
c4eb3af9f2cd833057a02ff1110c632d6721aeb831ed7085865c6998a243648a
|
File details
Details for the file config_enhance-1.2.2-py2.7.egg.
File metadata
- Download URL: config_enhance-1.2.2-py2.7.egg
- Upload date:
- Size: 7.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4132f1d884bc64fd5327835cd06166e161b31db0676e2ddf076bfa5a1166023e
|
|
| MD5 |
4d6a37234702f7c57eb4622c1bfd8def
|
|
| BLAKE2b-256 |
01f4534d649b261d8b83ee12c4678e8533e6f3f8b51b1d6cf4fadc6aca9d3d50
|