Created
September 12, 2012 17:34
-
-
Save macdhuibh/3708438 to your computer and use it in GitHub Desktop.
This file contains 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
from pygithub3 import Github | |
def Members(github, organisation): | |
pages = github.orgs.members.list(organisation) | |
print 'Members of ' + organisation | |
for members in pages: | |
for member in members: | |
print member.login | |
return members | |
def My_issues(github): | |
pages = github.issues.list() | |
print 'My Issues' | |
for issues in pages: | |
for issue in issues: | |
print " %s - %s" % (issue.number, issue.title) | |
return issues | |
def repos_by_organisation(github, organisation): | |
pages = github.repos.list_by_org(org=organisation) | |
for repos in pages: | |
for repo in repos: | |
print repo | |
return repos | |
def issues_by_repos_by_member(github, organisation): | |
repos_page = github.repos.list_by_org(organisation) | |
members = Members(github, organisation) | |
print '' | |
for repos in repos_page: | |
for repo in repos: | |
print '' | |
if repo.has_issues and repo.open_issues > 0: | |
print 'Repo:', repo.name | |
for member in members: | |
print ' Member: ', member.login | |
try: | |
issues_pages = github.issues.list_by_repo(user=organisation, repo=repo.name, assignee=member.login) | |
for issues in issues_pages: | |
for issue in issues: | |
print ' ', issue.number, issue.title | |
except: | |
print 'None for ', member.login | |
issues_pages = github.issues.list_by_repo(user=organisation, repo=repo.name, assignee='none') | |
print ' No assignee:' | |
for issues in issues_pages: | |
for issue in issues: | |
print ' ', issue.number, issue.title | |
def main(): | |
organisation = 'my-organisation' | |
auth = dict(login='my-account', password='my-password') | |
github = Github(**auth) | |
print "" | |
My_issues(github) | |
print "" | |
issues_by_repos_by_member(github, organisation) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment