config module¶
The config module is part of the nmeta suite.
It represents nmeta configuration data.
It loads configuration from file, validates keys and provides access to values
It expects a file called “config.yaml” to be in the config subdirectory, containing properly formed YAML
-
class
config.
Config
(dir_default='config', dir_user='config/user', config_filename='config.yaml')¶ Bases:
baseclass.BaseClass
This class is instantiated by nmeta.py and provides methods to ingest the configuration file and provides access to the keys/values that it contains. Config file is in YAML in config subdirectory and is called ‘config.yaml’
-
ingest_config_default
(config_filename, dir_default)¶ Ingest default config file
-
ingest_config_user
(config_filename, dir_user)¶ Ingest user config file that overrides values set in the default config file.
-
ingest_config_file
(fullpath)¶ Passed full path to a YAML-formatted config file and ingest into a dictionary
-
get_value
(config_key)¶ Passed a key and see if it exists in the config YAML. If it does then return the value, if not return 0
-
inherit_logging
(config)¶ Call base class method to set up logging properly for this class now that it is running
-