| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
priority 2 messages.
|
|
|
|
When sending messages with priority=2, the receipt now contains more
information. We make it available as additional fields to the
MessageRequest object
|
|
|
|
Implement canceling emergency-priority retries
|
|
|
|
see API description at https://pushover.net/api
|
|
Update documentation to reflect addition of the 'html' parameter
|
|
Enable HTML Message Support as described in http://updates.pushover.net/post/117525190347/html-message-support
|
|
Previously, this could only be done through the config.
|
|
The help, example and actual code had different opinions on how the function
should behave. This commit make them agree.
poll() will return the base Request object until the receipt has expired, been
acknowledged or called_back upon. Once one of those three things has occurred
it returns None.
The example now has expire=120 and retry=60 since without those arguments it is
unable to send a message with priority=2.
The expired_at does not exist, it is called expires_at in the Pushover API.
This is fixed as well.
The values of expires_at, acknowledged_at and called_back_at can be found as
attributes in the MessageRequest object like before.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Conflicts:
pushover.py
use `value is True` instead of `value == True`
|
|
|
|
|
|
Convenience function to create a client
|
|
|
|
(self.answer is a dict)
|
|
I think it makes sense to init() in here too, and allow the user to keep the api_tokens in the config file.
|
|
I think this is supposed to be a return rather than a print. Print returns none and string serialization fails.
|
|
|
|
Loads a config file at and creates a client according to various options. Handy IMO so you don't have to constantly look up your user key etc. Has some precedent in a similar system used by boto for AWS credentials (http://boto.readthedocs.org/en/latest/boto_config_tut.html)
|
|
We need to test boolean only :
>>> key="timestamp"
>>> value="123456"
>>>
>>> if key == "timestamp" and value:
... print "Value <> True but, still true"
... else:
... print "value <> True and false"
...
Value <> True but, still true
|
|
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
|
|
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
|
|
|
|
|
|
|
|
|
|
|