Exemple #1
0
# see http://developer.github.com/v3/oauth/#create-a-new-authorization
print("Enter github username:"******"Issue #125: ", end=' ')
# Any issue can be referenced by number
print(issues[125])
end = gh.rate_limiting
print("Requests used: ", start[0] - end[0])
print("Cache hits: %s misses: %s" % (issues.cache_hits, issues.cache_misses))

# Pull requests are treated as issues
issues = GithubIssues(gh, 'avocado-framework/avocado-vt')
start = end
print("Pull #526: ", end=' ')
print(issues[526])
end = gh.rate_limiting
print("Requests used: ", start[0] - end[0])
print("Cache hits: %s misses: %s" % (issues.cache_hits, issues.cache_misses))
Exemple #2
0
    print
    if len(labels) > 0:
        mutable_issue['labels'] = labels


gh = Github(login_or_token=input("Enter github username: "******"Enter location (<user>/<repo>)",
repo_full_name = 'avocado-framework/avocado-vt'
repo_full_name = input(
    "or blank for '%s': " % repo_full_name).strip() or repo_full_name
print

issues = GithubIssues(gh, repo_full_name)

# Can't directly search for no labels
criteria = {
    'state': 'open',
    'sort': 'updated',
    'direction': 'asc'
}  # updated-asc == oldest first

heading = ("Open, unlabeled issues from %s, oldest-first" % repo_full_name)
print heading
print "-" * len(heading)
print

repo = gh.get_repo(repo_full_name)
labels = ", ".join([label.name for label in repo.get_labels()])
Exemple #3
0
import datetime
from github import Github
from github_issues import GithubIssues

gh = Github(login_or_token=raw_input("Enter github username: "******"Enter location (<user>/<repo>)",
repo_full_name = 'autotest/virt-test'
repo_full_name = raw_input("or blank for '%s': "
                           % repo_full_name).strip() or repo_full_name

print

issues = GithubIssues(gh, repo_full_name)

print "Enter github labels, blank to end:"
labels = []
while True:
    label = raw_input("labels[%d]" % (len(labels) + 1))
    label = label.strip()
    if label:
        try:
            # http://jacquev6.github.io
            # /PyGithub/github_objects/Label.html#github.Label.Label
            labels.append(issues.get_gh_label(label).name)
        except ValueError, detail:
            print str(detail)
    else:
        break
Exemple #4
0
            break
    print
    if len(labels) > 0:
        mutable_issue['labels'] = labels

gh = Github(login_or_token=raw_input("Enter github username: "******"Enter location (<user>/<repo>)",
repo_full_name = 'autotest/virt-test'
repo_full_name = raw_input("or blank for '%s': "
                           % repo_full_name).strip() or repo_full_name
print

issues = GithubIssues(gh, repo_full_name)

# Can't directly search for no labels
criteria = {'state':'open',
            'sort':'updated', 'direction':'asc'} # updated-asc == oldest first

heading = ("Open, unlabeled issues from %s, oldest-first" % repo_full_name)
print heading
print "-" * len(heading)
print

repo = gh.get_repo(repo_full_name)
labels = ", ".join( [label.name for label in repo.get_labels()] )

for number in issues.search(criteria):
    if len(issues[number]['labels']) > 0:
Exemple #5
0
import sys
import getpass

from github import Github
from github_issues import GithubIssues

from six.moves import input


gh = Github(login_or_token=input("Enter github username: "******"Enter location (<user>/<repo>)",
repo_full_name = 'avocado-framework/avocado-vt'
repo_full_name = input("or blank for '%s': "
                       % repo_full_name).strip() or repo_full_name

print

issues = GithubIssues(gh, repo_full_name)

for issue in issues:
    sys.stdout.write(str(issue['number']) + '\n')
    sys.stdout.flush()

# make sure cache is cleaned and saved up
del issues

print
Exemple #6
0
print "Enter github username:"******"Issue #125: ",
# Any issue can be referenced by number
print issues[125]
end = gh.rate_limiting
print "Requests used: ", start[0] - end[0]
print "Cache hits: %s misses: %s" % (issues.cache_hits, issues.cache_misses)

# Pull requests are treated as issues
issues = GithubIssues(gh, 'autotest/virt-test')
start = end
print "Pull #526: ",
print issues[526]
end = gh.rate_limiting
print "Requests used: ", start[0] - end[0]
print "Cache hits: %s misses: %s" % (issues.cache_hits, issues.cache_misses)