Created
January 5, 2017 01:13
-
-
Save grantmcconnaughey/0456b67ab0e3b1ec5c180cd6e416222d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This dict lives in its own file | |
git_clients = { | |
GITHUB: GitHubBackend, | |
DUMMY: DummyGitBackend | |
} | |
def get_projects(self, service): | |
# Dynamic based on the service | |
GitBackend = git_clients[service] | |
git_client = GitBackend(user=self) | |
repo_full_names = [r.full_name for r in git_client.get_user_repos()] | |
projects = Project.objects.filter(full_name__in=repo_full_names, service=service) | |
return projects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment