How to use the kas.repos.Repo.factory function in kas

To help you get started, we’ve selected a few kas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github siemens / kas / kas / config.py View on Github external
def _get_repo_dict(self):
        """
            Returns a dictionary containing the repositories with
            their names (as it is defined in the config file) as keys
            and the `Repo` instances as values.
        """
        repo_config_dict = self._config.get('repos', {})
        repo_defaults = self._config.get('defaults', {}).get('repos', {})
        repo_dict = {}
        repo_fallback_path = os.path.dirname(self.filenames[0])
        for repo in repo_config_dict:
            repo_config_dict[repo] = repo_config_dict[repo] or {}
            repo_dict[repo] = Repo.factory(repo,
                                           repo_config_dict[repo],
                                           repo_defaults,
                                           repo_fallback_path)

        return repo_dict