Пример #1
0
 def __consume_config(self, config_name):
     if config_name in self.configs:
         _config = op_yaml.read_yaml(path=self.configs[config_name])
         for k, v in _config.iteritems():
             _configPath = op_string.resolve_string(
                 data=self.core_variables, string=v)
             self.configs.update({k: _configPath})
Пример #2
0
 def __consume_template_config(self, key_name):
     if key_name in self.configs:
         _configPath = self.configs.get(key_name)
         for item in op_yaml.read_yaml(path=_configPath):
             for k, v in item.items():
                 _configPath = op_string.resolve_string(
                     data=self.core_variables, string=v)
                 self.core_variables.update({k: _configPath})
Пример #3
0
 def __consume_miscellaneous_config(self):
     config_name = "miscellaneous"
     if config_name in self.configs:
         _config = op_yaml.read_yaml(path=self.configs[config_name])
         for k, v in _config.iteritems():
             _configPath = op_string.resolve_string(
                 data=self.core_variables, string=v)
             self.configs.update({k: _configPath})
             self.__consume_template_config(key_name=k)
Пример #4
0
 def __consume_application_config(self):
     self.__consume_config(config_name="application")
     _applicationConfig = self.configs.get("application")
     if _applicationConfig:
         for k, v in op_yaml.read_yaml(
                 path=self.configs["application"]).items():
             _configPath = op_string.resolve_string(
                 data=self.core_variables, string=v)
             self.configs.update({k: _configPath})
             self.__initialise_application(config_path=_configPath)
Пример #5
0
 def __consume_core_config(self):
     self.core_variables.update({"_script_source": ROOT_DIR})
     _configSource = os.path.join(ROOT_DIR, "configs")
     self.core_variables.update({"_config_source": _configSource})
     _config = op_yaml.read_yaml(
         path=os.path.join(_configSource, "core.yaml"))
     for k, v in _config["configs"].iteritems():
         self.configs.update({
             k:
             op_string.resolve_string(data=self.core_variables, string=v)
         })
     for k, v in _config["sources"].iteritems():
         self.core_variables.update({
             k:
             op_string.resolve_string(data=self.core_variables, string=v)
         })
Пример #6
0
 def __initialise_application(self, config_path):
     _data = op_yaml.read_yaml(path=config_path)
     application_object.Application(environment=self, config_data=_data)
Пример #7
0
 def __consume_system_config(self):
     if "system" in self.configs:
         _config = op_yaml.read_yaml(path=self.configs["system"])
         self.core_variables.update(_config[self.platform])