1- # pushover 0.2
1+ # pushover 0.3
22#
3- # Copyright (C) 2013-2014 Thibaut Horel <thibaut.horel@gmail.com>
3+ # Copyright (C) 2013-2016 Thibaut Horel <thibaut.horel@gmail.com>
44
55# This program is free software: you can redistribute it and/or modify
66# it under the terms of the GNU General Public License as published by
@@ -330,7 +330,9 @@ def main():
330330 parser .add_argument ("--user-key" , "-u" , help = "Pushover user key" )
331331 parser .add_argument ("message" , help = "message to send" )
332332 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 )
334336 parser .add_argument ("--url" , help = "additional url" )
335337 parser .add_argument ("--url-title" , help = "additional url title" )
336338 parser .add_argument ("-c" , "--config" , help = "configuration file\
@@ -341,17 +343,21 @@ def main():
341343 parser .add_argument ("--version" , "-v" , action = "version" ,
342344 help = "output version information and exit" ,
343345 version = """
344- %(prog)s 0.2
346+ %(prog)s 0.3
345347Copyright (C) 2013-2016 Thibaut Horel <thibaut.horel@gmail.com>
346348License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
347349This is free software: you are free to change and redistribute it.
348350There is NO WARRANTY, to the extent permitted by law.""" )
349351
350352 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+
351356 Client (args .user_key , None , args .api_token , args .config ,
352357 args .profile ).send_message (args .message , title = args .title ,
353358 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 )
355361
356362if __name__ == "__main__" :
357363 main ()
0 commit comments