Skip to content

Commit

Permalink
Merge fixes from 'praseodym/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
FraGag committed Dec 7, 2013
2 parents 9ba1b8b + d64bd5e commit 8ac23d2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions captainhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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 @@ -54,8 +54,8 @@
if not overwrite:
## Get all existing hooks
hs = requests.get(hurl, auth=auth)
if not r.ok:
print " Failed: ", name
if not hs.ok:
print " Failed:", name
continue
hj = json.loads(hs.text or hs.content)
## Look for existing hook that matches this one
Expand All @@ -71,8 +71,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

0 comments on commit 8ac23d2

Please sign in to comment.