1
- # pushover 0.2
1
+ # pushover 0.3
2
2
#
3
- # Copyright (C) 2013-2014 Thibaut Horel <thibaut.horel@gmail.com>
3
+ # Copyright (C) 2013-2016 Thibaut Horel <thibaut.horel@gmail.com>
4
4
5
5
# This program is free software: you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
@@ -330,7 +330,9 @@ def main():
330
330
parser .add_argument ("--user-key" , "-u" , help = "Pushover user key" )
331
331
parser .add_argument ("message" , help = "message to send" )
332
332
parser .add_argument ("--title" , "-t" , help = "message title" )
333
- parser .add_argument ("--priority" , "-p" , help = "message priority (-1, 0, 1 or 2)" )
333
+ parser .add_argument ("--priority" , "-p" , help = "message priority (-1, 0, 1 or 2)" , type = int )
334
+ parser .add_argument ("--retry" , "-r" , help = "how often (in seconds) the Pushover servers will send the same notification to the user" , type = int )
335
+ parser .add_argument ("--expire" , "-e" , help = "how many seconds your notification will continue to be retried for (every retry seconds)." , type = int )
334
336
parser .add_argument ("--url" , help = "additional url" )
335
337
parser .add_argument ("--url-title" , help = "additional url title" )
336
338
parser .add_argument ("-c" , "--config" , help = "configuration file\
@@ -341,17 +343,21 @@ def main():
341
343
parser .add_argument ("--version" , "-v" , action = "version" ,
342
344
help = "output version information and exit" ,
343
345
version = """
344
- %(prog)s 0.2
346
+ %(prog)s 0.3
345
347
Copyright (C) 2013-2016 Thibaut Horel <thibaut.horel@gmail.com>
346
348
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
347
349
This is free software: you are free to change and redistribute it.
348
350
There is NO WARRANTY, to the extent permitted by law.""" )
349
351
350
352
args = parser .parse_args ()
353
+ if args .priority and args .priority == 2 and (args .retry is None or args .expire is None ):
354
+ parser .error ("priority of 2 requires expire and retry" )
355
+
351
356
Client (args .user_key , None , args .api_token , args .config ,
352
357
args .profile ).send_message (args .message , title = args .title ,
353
358
priority = args .priority , url = args .url ,
354
- url_title = args .url_title , timestamp = True )
359
+ url_title = args .url_title , timestamp = True ,
360
+ retry = args .retry ,expire = args .expire )
355
361
356
362
if __name__ == "__main__" :
357
363
main ()
0 commit comments