config_loader#
This module provides a class to load configuration files from the ClearMap configuration directory.
The configuration files are used to store the parameters for the ClearMap processing steps. Currently, they are stored as configobj files, but other formats like json or yaml could be supported in the future through a simple plugin function to this module (see the not_implemented functions). All that is required is that the object returned by these plugin functions implements read, write, and reload methods, a filename attribute and behaves as a python dictionary.
- class ConfigLoader(src_dir)[source]#
Bases:
object
- get_cfg_path(cfg_name, must_exist=True)[source]#
- Parameters:
cfg_name (str)
must_exist (bool)
Returns
- default_dir = '/home/crousseau/.clearmap/'#
- loader_functions = {'.cfg': <function get_configobj_cfg>, '.ini': <function get_configobj_cfg>, '.json': <function get_json_cfg>, '.yml': <function get_yml_cfg>}#
- supported_exts = ('.cfg', '.ini', '.yml', '.json')#
- get_json_cfg(cfg_path)[source]#
- Parameters:
(str) (cfg_path)
path (Returns Should return a dict like object with a write method and filename that gives the)
-------