##// END OF EJS Templates
a bit of cache and logging cleanup in gh_api
MinRK -
Show More
@@ -17,9 +17,9 b' import json'
17 17 try:
18 18 import requests_cache
19 19 except ImportError:
20 print("no cache")
20 print("no cache", file=sys.stderr)
21 21 else:
22 requests_cache.install_cache("gh_api")
22 requests_cache.install_cache("gh_api", expire_after=3600)
23 23
24 24 # Keyring stores passwords by a 'username', but we're not storing a username and
25 25 # password
@@ -124,7 +124,11 b' def get_paged_request(url, headers=None, **params):'
124 124 results = []
125 125 params.setdefault("per_page", 100)
126 126 while True:
127 print("fetching %s with %s" % (url, params), file=sys.stderr)
127 if '?' in url:
128 params = None
129 print("fetching %s" % url, file=sys.stderr)
130 else:
131 print("fetching %s with %s" % (url, params), file=sys.stderr)
128 132 response = requests.get(url, headers=headers, params=params)
129 133 response.raise_for_status()
130 134 results.extend(response.json())
General Comments 0
You need to be logged in to leave comments. Login now