def load_from_file(self, filename, client_configuration, bot_root): configuration = ProgramyConfiguration(client_configuration) with open(filename, 'r+') as xml_data_file: tree = ET.parse(xml_data_file, parser=LineNumberingParser()) self.xml_data = tree.getroot() configuration.load_config_data(self, bot_root) return configuration
def load_from_file(self, filename, client_configuration, bot_root): configuration = ProgramyConfiguration(client_configuration) with open(filename, 'r+', encoding="utf-8") as xml_data_file: tree = ET.parse(xml_data_file, parser=LineNumberingParser()) self.xml_data = tree.getroot() configuration.load_config_data(self, bot_root) return configuration
def load_from_text(self, text, client_configuration, bot_root): self.yaml_data = yaml.load(text) if self.yaml_data is None: raise Exception("Yaml data is missing") configuration = ProgramyConfiguration(client_configuration) configuration.load_config_data(self, bot_root) return configuration
def load_from_file(self, filename, client_configuration, bot_root): configuration = ProgramyConfiguration(client_configuration) try: with open(filename, 'r+', encoding="utf-8") as json_data_file: self.json_data = json.load(json_data_file) configuration.load_config_data(self, bot_root) except Exception as excep: YLogger.exception(self, "Failed to open json config file [%s]", excep, filename) return configuration
def load_from_text(self, text, client_configuration, bot_root, subs: Substitutions = None): self.yaml_data = yaml.load(text, Loader=yaml.FullLoader) if self.yaml_data is None: raise Exception("Yaml data is missing") configuration = ProgramyConfiguration(client_configuration) configuration.load_config_data(self, bot_root, subs=subs) return configuration
def load_from_file(self, filename, client_configuration, bot_root, subs: Substitutions = None): configuration = ProgramyConfiguration(client_configuration) try: with open(filename, 'r+', encoding="utf-8") as yml_data_file: self.yaml_data = yaml.load(yml_data_file) configuration.load_config_data(self, bot_root, subs=subs) except Exception as excep: YLogger.exception(self, "Failed to open yaml config file [%s]", excep, filename) return configuration
def load_from_file(self, filename, client_configuration, bot_root, subs: Substitutions = None): configuration = ProgramyConfiguration(client_configuration) try: with open(filename, 'r+', encoding="utf-8") as xml_data_file: tree = ET.parse(xml_data_file, parser=LineNumberingParser()) self.xml_data = tree.getroot() configuration.load_config_data(self, bot_root, subs) except Exception as excep: YLogger.exception(self, "Failed to open xml config file [%s]", excep, filename) return configuration
def load_from_text(self, text, client_configuration, bot_root): tree = ET.fromstring(text) self.xml_data = tree configuration = ProgramyConfiguration(client_configuration) configuration.load_config_data(self, bot_root) return configuration
def load_from_file(self, filename, client_configuration, bot_root): configuration = ProgramyConfiguration(client_configuration) with open(filename, 'r+') as yml_data_file: self.yaml_data = yaml.load(yml_data_file) configuration.load_config_data(self, bot_root) return configuration
def load_from_text(self, text, client_configuration, bot_root): self.json_data = json.loads(text) configuration = ProgramyConfiguration(client_configuration) configuration.load_config_data(self, bot_root) return configuration
def load_from_file(self, filename, client_configuration, bot_root): configuration = ProgramyConfiguration(client_configuration) with open(filename, 'r+', encoding="utf-8") as json_data_file: self.json_data = json.load(json_data_file) configuration.load_config_data(self, bot_root) return configuration
def load_from_text(self, text, client_configuration, bot_root, subs: Substitutions = None): self.json_data = json.loads(text) configuration = ProgramyConfiguration(client_configuration) configuration.load_config_data(self, bot_root, subs) return configuration