diff options
author | 2012-03-03 11:26:04 +0100 | |
---|---|---|
committer | 2012-03-03 11:29:56 +0100 | |
commit | 8345cf66caedf989a8b176e1ecf551bb6d9e846e (patch) | |
tree | fe629e13576b1af33a8aedc1cb3e703dea560bd9 /pygithub3/core/client.py | |
parent | Service repos done (diff) | |
download | python-github3-8345cf66caedf989a8b176e1ecf551bb6d9e846e.tar.xz python-github3-8345cf66caedf989a8b176e1ecf551bb6d9e846e.zip |
remaining_requests attr to Github and Services
Updated with each request
Diffstat (limited to 'pygithub3/core/client.py')
-rw-r--r-- | pygithub3/core/client.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pygithub3/core/client.py b/pygithub3/core/client.py index a8e33a1..ee7c97f 100644 --- a/pygithub3/core/client.py +++ b/pygithub3/core/client.py @@ -14,6 +14,8 @@ VALID_REQUEST_ARGS = set(( class Client(object): """ Client to send configurated requests""" + remaining_requests = '~' + def __init__(self, **kwargs): self.requester = requests.session() self.config = { @@ -72,6 +74,8 @@ class Client(object): def request(self, verb, request, **kwargs): request = "%s%s" % (self.config['base_url'], request) response = self.requester.request(verb, request, **kwargs) + Client.remaining_requests = response.headers.get( + 'x-ratelimit-remaining', -1) GithubError(response).process() return response |