diff --git a/tools/gh_api.py b/tools/gh_api.py index 9d2a756..7bacc9e 100644 --- a/tools/gh_api.py +++ b/tools/gh_api.py @@ -17,9 +17,9 @@ import json try: import requests_cache except ImportError: - print("no cache") + print("no cache", file=sys.stderr) else: - requests_cache.install_cache("gh_api") + requests_cache.install_cache("gh_api", expire_after=3600) # Keyring stores passwords by a 'username', but we're not storing a username and # password @@ -124,7 +124,11 @@ def get_paged_request(url, headers=None, **params): results = [] params.setdefault("per_page", 100) while True: - print("fetching %s with %s" % (url, params), file=sys.stderr) + if '?' in url: + params = None + print("fetching %s" % url, file=sys.stderr) + else: + print("fetching %s with %s" % (url, params), file=sys.stderr) response = requests.get(url, headers=headers, params=params) response.raise_for_status() results.extend(response.json())