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)
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)
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)
def load_config_from_name(name): config = download_config(url_config[name]) return Cfg(config)