def update_with_file(self, f): """ Updates the environment using an ini file containing key/value descriptions. """ config = ConfigParser() with open(f, 'r') as f: config.readfp(f) for section in config.sections(): self.update(items_to_dict(config.items(section)))
def load_from_file(self, env_file): """ Updates the environment using an ini file containing key/value descriptions. """ config = ConfigParser() with open(env_file, 'r') as f: config.readfp(f) for section in config.sections(): self.update({section: items_to_dict(config.items(section))})