예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #8
0
파일: xml_file.py 프로젝트: lilnana00/3ddd
    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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #15
0
파일: json_file.py 프로젝트: lilnana00/3ddd
 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
예제 #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