Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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
Beispiel #4
0
 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
Beispiel #5
0
    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
Beispiel #6
0
 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
Beispiel #7
0
    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
Beispiel #8
0
    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
Beispiel #9
0
 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
Beispiel #10
0
 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
Beispiel #11
0
 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
Beispiel #12
0
 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
Beispiel #13
0
 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
Beispiel #14
0
 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
Beispiel #15
0
 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
Beispiel #16
0
 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