Esempio n. 1
0
    def get_config(self):
        cconfig = self.get_component_config()
        config = {}
        cfiles = []

        if 'file' in cconfig:
            if isinstance(cconfig['file'], list):
                cfiles.extend(cconfig['file'])
            else:
                cfiles.append(cconfig['file'])
        else:
            cfiles.extend(self.find_default_locations())

        for cfile in cfiles:
            merge(config, self.load_file(cfile))

        return config
Esempio n. 2
0
File: file.py Progetto: mensi/cydra
    def get_config(self):
        cconfig = self.get_component_config()
        config = {}
        cfiles = []

        if 'file' in cconfig:
            if isinstance(cconfig['file'], list):
                cfiles.extend(cconfig['file'])
            else:
                cfiles.append(cconfig['file'])
        else:
            cfiles.extend(self.find_default_locations())

        for cfile in cfiles:
            merge(config, self.load_file(cfile))

        return config
Esempio n. 3
0
 def post_create_project(self, project):
     config = self.component_config.get("config", {})
     logger.debug("Extending project %s with config %r", project.name, config)
     merge(project.data, config)
     project.save()