Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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