Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Add rate limit to push return (#143)
Browse files Browse the repository at this point in the history
Rate limit information added to _push return
  • Loading branch information
SDoehren authored Oct 20, 2020
1 parent 3071dc2 commit ad8b878
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pushbullet/pushbullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ def push_link(self, title, url, body=None, device=None, chat=None, email=None, c
def _push(self, data):
r = self._session.post(self.PUSH_URL, data=json.dumps(data))
if r.status_code == requests.codes.ok:
return r.json()
js = r.json()
js['Ratelimit-Reset'] = r.headers['X-Ratelimit-Reset']
js['Ratelimit-Limit'] = r.headers['X-Ratelimit-Limit']
js['Ratelimit-Remaining'] = r.headers['X-Ratelimit-Remaining']
return js
else:
raise PushError(r.text)

Expand Down

0 comments on commit ad8b878

Please sign in to comment.