Esempio n. 1
0
    def load_config_from_name(name):
        base_config = download_config(url_config['base'])
        config = download_config(url_config[name])

        config.update(base_config)

        return Cfg(config)
Esempio n. 2
0
    def load_config_from_file(fname):
        base_config = download_config(url_config['base'])

        with open(fname, encoding='utf-8') as f:
            config = yaml.safe_load(f)
        base_config.update(config)

        return Cfg(base_config)
Esempio n. 3
0
    def load_config_from_file(fname, download_base=False):
        if not download_base:
            with open("config/base.yml", encoding='utf-8') as f:
                base_config = yaml.safe_load(f)
        else:
            base_config = download_config(url_config['base'])

        with open(fname, encoding='utf-8') as f:
            config = yaml.safe_load(f)
        base_config.update(config)

        return Cfg(base_config)
Esempio n. 4
0
 def load_config_from_name(name):
     config = download_config(url_config[name])
     return Cfg(config)