Example #1
0
 def save_config(self):
     coordinator.profile = self.profile
     conf_path = utils.get_config_path()
     if not conf_path.exists():
         conf_path.parent.mkdir(parents=True, exist_ok=True)
     with open(conf_path, 'w') as f:
         self.yaml.dump(self.config, f)
Example #2
0
 def save_config(self):
     coordinator.profile = self.profile
     conf_path = utils.get_config_path()
     if not os.path.exists(conf_path):
         os.makedirs(os.path.dirname(conf_path))
     with open(conf_path, 'w') as f:
         self.yaml.dump(self.config, f)
Example #3
0
 def load_config(self):
     coordinator.profile = self.profile
     conf_path = utils.get_config_path()
     if not os.path.exists(conf_path):
         self.config = self.yaml.load(self.default_config())
     else:
         with open(conf_path) as f:
             self.config = self.yaml.load(f)
     self.load_modules_list()
Example #4
0
    def load_config(self):
        coordinator.profile = self.profile
        conf_path = utils.get_config_path()
        if not os.path.exists(conf_path):
            self.config = self.yaml.load(self.default_config())

            # Fill in required fields
            if "master_channel" not in self.config:
                self.config['master_channel'] = ""
            if "slave_channels" not in self.config:
                self.config["slave_channels"] = []
            if "middlewares" not in self.config:
                self.config["middlewares"] = []
        else:
            with open(conf_path) as f:
                self.config = self.yaml.load(f)
        self.load_modules_list()