Skip to content

Commit

Permalink
Fix pagination and prints
Browse files Browse the repository at this point in the history
  • Loading branch information
praseodym committed Sep 24, 2013
1 parent 8a948ff commit d64bd5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions captainhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
auth = requests.auth.HTTPBasicAuth(username, password)

doall = False
r = requests.get('https://api.github.com/orgs/%s/repos' % (org,), auth=auth)
r = requests.get('https://api.github.com/orgs/%s/repos?per_page=100' % (org,), auth=auth)
if r.ok:
j = json.loads(r.text or r.content)
for org in j:
Expand All @@ -53,7 +53,7 @@
## Get all existing hooks
hs = requests.get(hurl, auth=auth)
if not hs.ok:
print " Failed: ", name
print " Failed:", name
continue
hj = json.loads(hs.text or hs.content)
## Look for existing hook that matches this one
Expand All @@ -69,10 +69,10 @@
headers = {'Content-type': 'application/json'}
k = requests.post(hurl, auth=auth, data=json.dumps(hook), headers=headers)
if k.ok:
print " Set hook for ", name
print " Set hook for", name
else:
print " Failed to set hook for ", name
print " Failed to set hook for", name
else:
print " Hook already exists for ", name
print " Hook already exists for", name
else:
print " Failed: ", r
print " Failed:", r

0 comments on commit d64bd5e

Please sign in to comment.