Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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