class documentation

class ConfigLoader:

View In Hierarchy

Reads all config files in a folder Behaves like a dictionary of all config files

Method __contains__ Same as a dictionary. :param item: config key :type item: str :return: True if item is in self.loaded_conf
Method __getitem__ Returns a yaml config object if in self.loaded_conf :param item: config key :type item: str :raise KeyError: if item is not in self.loaded_conf :return: config value
Method __init__ Defines the config folder and loads all configs :param config_folder: path to config file :type config_folder: (str | list[str]) :param extensions: file extensions to load :type extensions: list[str] :raise TypeError: if config_folder is not a string or a list of strings...
Method __repr__ Returns config as string :return: the dict of configs and their values :rtype: str
Method add_folder Add a Folder to the list of configs :param folder: path to folder :type folder: str :return: None
Method load_from_file Loads a config file :param filepath: path to config file :type filepath: str :return: None
Method load_from_folder Loads all configs in the config folder :param folder: path to folder :type folder: str :return: None
Method reload_all Reloads all configs :return: None
Instance Variable config_folders Undocumented
Instance Variable extensions Undocumented
Instance Variable loaded_conf Undocumented
def __contains__(self, item):

Same as a dictionary. :param item: config key :type item: str :return: True if item is in self.loaded_conf

def __getitem__(self, item):

Returns a yaml config object if in self.loaded_conf :param item: config key :type item: str :raise KeyError: if item is not in self.loaded_conf :return: config value

def __init__(self, config_folder=None, extensions=('yaml', 'yml')):

Defines the config folder and loads all configs :param config_folder: path to config file :type config_folder: (str | list[str]) :param extensions: file extensions to load :type extensions: list[str] :raise TypeError: if config_folder is not a string or a list of strings

def __repr__(self):

Returns config as string :return: the dict of configs and their values :rtype: str

def add_folder(self, folder):

Add a Folder to the list of configs :param folder: path to folder :type folder: str :return: None

def load_from_file(self, filepath):

Loads a config file :param filepath: path to config file :type filepath: str :return: None

def load_from_folder(self, folder):

Loads all configs in the config folder :param folder: path to folder :type folder: str :return: None

def reload_all(self):

Reloads all configs :return: None

config_folders: list =

Undocumented

extensions =

Undocumented

loaded_conf: dict =

Undocumented