def load_default_config_from_pyfile(self, filename): config = Config(root_path=self.root_path) config.from_pyfile(filename) for key, default_value in config.items(): self.config.setdefault(key, default_value)
def load_config(self): config = Config(current_app.root_path) config.from_pyfile(path.join(path.dirname(current_app.root_path), 'config.py')) for option, value in config.items(): setattr(self, option, value)
def load_default_config_from_pyfile(self, filename): config = Config(root_path=self.root_path) config.from_pyfile(filename) for key, default_value in config.items(): self.config.setdefault(key, default_value)