class msiempy.NitroConfig(configparser.ConfigParser): (source)
configparser.ConfigParser
parser object.
Handles the configuration. Reads the config file .msiem/conf.ini
and make accessible it's values throught object properties.
Default configuration file should look like this. Authentication is left empty:
[esm] host = user = passwd = [general] verbose = False quiet = False logfile = timeout = 60 ssl_verify = False
%APPDATA%.msiemconf.ini
$HOME/.msiem/conf.ini
$XDG_CONFIG_HOME/.msiem/conf.ini
or : $HOME/.msiem/conf.ini
.msiem
folder exists in your current directory : ./.msiem/conf.ini
(Unix only)You can setup the configuration by command line with msiempy_setup.py script.
Method | __init__ | Create the configuration parser |
Class Variable | CONFIG_FILE_NAME | .msiem/conf.ini |
Class Variable | CONF_DIR | .msiem/ |
Class Variable | DEFAULT_CONF_DICT | Default configuration values. |
Method | __str__ | Custom str() method that lists all config fields. |
Method | write | Write the config file to the predetermined path . |
Method | iset | Interactively set the specified section/option by asking the user the input. |
Method | user | Config value section "esm" optiom "user" |
Method | host | Config section "esm" option "host" |
Method | passwd | Config value section "esm" option "passwd" |
Method | verbose | Config value section "general" option "verbose" |
Method | quiet | Config value section "general" option "quiet" |
Method | logfile | Config value section "general" option "logfile" |
Method | timeout | Config value section "general" option "timeout" |
Method | ssl_verify | Config value section "general" option "ssl_verify" |
Static Method | find_ini_location | No summary |
Instance Variable | _path | Undocumented |
Method | _iset | Internal method to interactively set a option in a section. |
Interactively set the specified section/option by asking the user the input.
conf.ini
file.
If .msiem
folder exists in you local directory, assume the conf.ini
file is in there.
If the file doesn't exist, will still return the location.
Do not create a file nor directory, you must call msiempy.core.config.NitroConfig.write
.