Created
January 14, 2016 03:57
-
-
Save bear/b4bd32ca79d89c355182 to your computer and use it in GitHub Desktop.
List all of your pull requests
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
#!/usr/bin/env python | |
import os | |
import json | |
# pip install PyGithub | |
from github import Github | |
github_config = os.path.expanduser('~/.github.cfg') | |
with open(github_config, 'r') as h: | |
cfg = json.load(h) | |
if cfg['auth_token'] is None: | |
error('Unable to retrieve the auth token from the configuration file %s' % github_config) | |
else: | |
gh = Github(cfg['auth_token']) | |
myid = gh.get_user().id | |
for issue in gh.search_issues('type:pr is:open'): | |
if issue.user.id == myid: | |
print issue.number, issue.title, issue.html_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://pygithub.readthedocs.org/en/stable/github_objects/Issue.html#github.Issue.Issue