コード例 #1
0
ファイル: xml_file.py プロジェクト: darylfung96/program-y
 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
ファイル: xml_file.py プロジェクト: Freiza/program-y
 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
ファイル: yaml_file.py プロジェクト: Freiza/program-y
 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
ファイル: xml_file.py プロジェクト: darylfung96/program-y
 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
ファイル: json_file.py プロジェクト: darylfung96/program-y
 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
ファイル: json_file.py プロジェクト: whackur/chatbot
 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
ファイル: json_file.py プロジェクト: Freiza/program-y
 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
ファイル: json_file.py プロジェクト: Freiza/program-y
 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
ファイル: xml_file.py プロジェクト: Freiza/program-y
 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