Wrapper to ConfigParser
Project description
# pywrapper-config
Wrapper to ConfigParser
tests.conf file:
```
[time]
pidfile_timeout = 5
[server]
ip = "127.0.0.1"
port = "8080"
```
tests2.conf file:
```
[time]
sleep = 3
[paths]
null = /dev/null
stdout = /dev/tty
stderr = /dev/tty
[conex]
port = 9080
```
How to use pywraper-config:
```
import pywrapper_config
config = pywrapper_config.Config("./tests.conf")
#Show sections
print("Sections: {0} ".format(config.show_sections()))
#Show server section
print("Items server section: {0} ".format(config.show_item_section("server")))
#Show ip server
print("IP: {0}".format(config.show_value_item("server","ip")))
#Show config file
print("Config file: {0}".format(config.cnffile))
#Change config file
config.cnffile = "./conf/tests2.py"
print("Config file: {0}".format(config.cnffile))
#Show sections from new config file
print("Secciones: {0}".format(config.show_sections()))
```
Wrapper to ConfigParser
tests.conf file:
```
[time]
pidfile_timeout = 5
[server]
ip = "127.0.0.1"
port = "8080"
```
tests2.conf file:
```
[time]
sleep = 3
[paths]
null = /dev/null
stdout = /dev/tty
stderr = /dev/tty
[conex]
port = 9080
```
How to use pywraper-config:
```
import pywrapper_config
config = pywrapper_config.Config("./tests.conf")
#Show sections
print("Sections: {0} ".format(config.show_sections()))
#Show server section
print("Items server section: {0} ".format(config.show_item_section("server")))
#Show ip server
print("IP: {0}".format(config.show_value_item("server","ip")))
#Show config file
print("Config file: {0}".format(config.cnffile))
#Change config file
config.cnffile = "./conf/tests2.py"
print("Config file: {0}".format(config.cnffile))
#Show sections from new config file
print("Secciones: {0}".format(config.show_sections()))
```
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 Distributions
pywrapper_config-0.3.2.zip
(15.5 kB
view details)
pywrapper_config-0.3.2.tar.gz
(14.2 kB
view details)
File details
Details for the file pywrapper_config-0.3.2.zip
.
File metadata
- Download URL: pywrapper_config-0.3.2.zip
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 511cdfb43658f9c3eabaea1ddf749c3b9f76274af5e66528df34a067ed50ee56 |
|
MD5 | 9145b109c0bbf1264dfa99e898e37a87 |
|
BLAKE2b-256 | 0448f7154e4470547bca0b0260b626b3b3acb054f02e488570b60c1adcf7f9b5 |
File details
Details for the file pywrapper_config-0.3.2.tar.gz
.
File metadata
- Download URL: pywrapper_config-0.3.2.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da9facbc950207a7ed6352b1f18f5d0240e522f86b031874c25d07d266c52fb0 |
|
MD5 | b17c173909e04372cdf2e9206a46c82f |
|
BLAKE2b-256 | 87b913741f7c6d101b620f258ccb53183a4b2a31f7066d475c81ed7f109715df |