devctrl.utility.config_file.ConfigFile#
- class ConfigFile(filepath: str, init_values=None)[source]#
Bases:
objectClass managing a yaml config file. The file is loaded on creation and can be saved with .save().
You may initialize an instance with empty string as filepath, in this case no file will not be loaded or saved.
Methods
Get a path with ~ and environment variables expanded :raise KeyError: if name is not a valid key
Get a copy of the values dictionary
Save the current variables to the config file
Set the values from a dictionary
- __annotations__ = {}#
- __dict__ = mappingproxy({'__module__': 'devctrl.utility.config_file', '__firstlineno__': 6, '__doc__': '\nClass managing a yaml config file.\nThe file is loaded on creation and can be saved with .save().\n\nYou may initialize an instance with empty string as filepath,\nin this case no file will not be loaded or saved.\n', '__init__': <function ConfigFile.__init__>, 'save': <function ConfigFile.save>, 'get_or': <function ConfigFile.get_or>, 'get': <function ConfigFile.get>, 'get_path': <function ConfigFile.get_path>, 'get_path_or': <function ConfigFile.get_path_or>, 'set': <function ConfigFile.set>, 'get_values': <function ConfigFile.get_values>, 'set_values': <function ConfigFile.set_values>, '__contains__': <function ConfigFile.__contains__>, '__static_attributes__': ('filepath', 'values'), '__dict__': <attribute '__dict__' of 'ConfigFile' objects>, '__weakref__': <attribute '__weakref__' of 'ConfigFile' objects>, '__annotations__': {}})#
- __firstlineno__ = 6#
- __module__ = 'devctrl.utility.config_file'#
- __static_attributes__ = ('filepath', 'values')#
- __weakref__#
list of weak references to the object