diff options
| author | Crupuk <sebastien.andreatta@gmail.com> | 2013-07-22 12:59:21 +0200 |
|---|---|---|
| committer | Crupuk <sebastien.andreatta@gmail.com> | 2013-07-22 12:59:21 +0200 |
| commit | a5e3f13ed4e49755ee0b9895dc0ba29584eb27f4 (patch) | |
| tree | a88c45994117e1c487d7394060e4684da2e58985 | |
| parent | 06ba42b2ca1da1d9b5ce74f75ff925ef78bbda03 (diff) | |
| download | python-pushover-a5e3f13ed4e49755ee0b9895dc0ba29584eb27f4.tar.gz | |
Use true timestamp to avoid "Invalid timestamp"
With the original version i got :
python /usr/lib/python2.6/site-packages/pushover.py --token "NU2LC5g2G9jgVR9eHVLYAUmkFuPeky" --client "FWhJFb5wgV35bmzmaxeV976K1WqaFE" "Hello"
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pushover.py", line 227, in <module>
url_title=args.url_title, timestamp=True)
File "/usr/lib/python2.6/site-packages/pushover.py", line 207, in send_message
return MessageRequest(payload)
File "/usr/lib/python2.6/site-packages/pushover.py", line 104, in __init__
Request.__init__(self, "post", MESSAGE_URL, payload)
File "/usr/lib/python2.6/site-packages/pushover.py", line 86, in __init__
raise RequestError(self.answer["errors"])
__main__.RequestError:
==> timestamp is invalid
By casting time.time() the error disappears
| -rw-r--r-- | pushover.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pushover.py b/pushover.py index 5f5c61f..f6f8e98 100644 --- a/pushover.py +++ b/pushover.py @@ -193,7 +193,7 @@ class Client: raise ValueError("{0}: invalid message parameter".format(key)) if key == "timestamp" and value: - payload[key] = time.time() + payload[key] = int(time.time()) elif key == "sound": if not SOUNDS: get_sounds() |
