Changeset 2779

Show
Ignore:
Timestamp:
03/03/06 00:03:36 (19 years ago)
Author:
jerome
Message:

pknotify now works just fine with PyKotIcon? and is 100% generic.

Location:
pykota/trunk
Files:
17 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pknotify

    r2778 r2779  
    2828import os 
    2929import popen2 
     30import xmlrpclib 
    3031 
    3132from pykota.tool import Tool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 
     
    4142options : 
    4243 
    43   -v | --version       Prints pkbanner's version number then exits. 
    44   -h | --help          Prints this message then exits. 
     44  -v | --version             Prints pkbanner's version number then exits. 
     45  -h | --help                Prints this message then exits. 
    4546   
     47  -d | --destination h[:p]   Sets the destination hostname and optional 
     48                             port onto which contact the remote PyKotIcon 
     49                             application. This option is mandatory. 
     50                             When not specified, the port defaults to 7654. 
     51                              
     52  -a | --ask                 Tells pknotify to ask something to the end 
     53                             user. Then pknotify will output the result. 
     54                        
     55  -c | --confirm             Tells pknotify to ask for either a confirmation                        
     56                             or abortion. 
     57                              
     58  -n | --notify              Tells pknotify to send an informational message 
     59                             message to the end user. 
     60                              
     61  -q | --quit                Tells pknotify to send a message asking the 
     62                             PyKotIcon application to exit. This option can 
     63                             be combined with the other ones to make PyKotIcon 
     64                             exit after having sent the answer from the dialog. 
     65                              
     66  You MUST specify either --ask, --confirm, --notify or --quit. 
     67 
     68  arguments :              
     69   
     70    -a | --ask : Several arguments are accepted, or the form 
     71                 "label:varname:defaultvalue". The result will 
     72                 be printed to stdout in the following format : 
     73                 VAR1NAME=VAR1VALUE 
     74                 VAR2NAME=VAR2VALUE 
     75                 ... 
     76                 If the dialog was cancelled, nothing will be  
     77                 printed. If one of the varname is 'password' 
     78                 then this field is asked as a password (you won't 
     79                 see what you type in). 
     80                  
     81    -c | --confirm : A single argument is expected, representing the 
     82                     message to display. If the dialog is confirmed 
     83                     then pknotify will print OK, else CANCEL. 
     84                      
     85    -n | --notify : A single argument is expected, representing the                  
     86                    message to display. In this case pknotify will 
     87                    always print OK. 
     88                     
     89examples :                     
     90 
     91  pknotify -d client:7654 --confirm "This job costs :\n10 credits !" 
     92   
     93  would display the cost of a print job and asks for confirmation. 
    4694""") 
    4795         
    4896class PyKotaNotify(Tool) :         
    4997    """A class for pknotify.""" 
     98    def sanitizeMessage(self, msg) : 
     99        """Replaces \\n and returns a messagee in xmlrpclib Binary format.""" 
     100        return xmlrpclib.Binary(msg.replace("\\n", "\n")) 
     101         
    50102    def main(self, arguments, options) : 
    51103        """Notifies or asks questions to end users through PyKotIcon.""" 
    52         pass # TODO : do something ! 
    53  
     104        try : 
     105            (destination, port) = options["destination"].split(":") 
     106        except ValueError : 
     107            destination = options["destination"] 
     108            port = 7654 
     109        server = xmlrpclib.ServerProxy("http://%s:%s" % (destination, port)) 
     110        if options["ask"] : 
     111            labels = [] 
     112            varnames = [] 
     113            varvalues = {} 
     114            for arg in arguments : 
     115                try : 
     116                    (label, varname, varvalue) = arg.split(":", 2) 
     117                except ValueError :     
     118                    raise PyKotaCommandLineError, "argument '%s' is invalid !" % arg 
     119                labels.append(self.sanitizeMessage(label)) 
     120                varname = varname.lower() 
     121                varnames.append(varname) 
     122                varvalues[varname] = self.sanitizeMessage(varvalue) 
     123            result = server.askDatas(labels, varnames, varvalues)     
     124            if result["isValid"] : 
     125                for varname in varnames : 
     126                    print "%s=%s" % (varname.upper(), result[varname]) 
     127        elif options["confirm"] : 
     128            print server.showDialog(self.sanitizeMessage(arguments[0]), True) 
     129        elif options["notify"] : 
     130            print server.showDialog(self.sanitizeMessage(arguments[0]), False) 
     131             
     132        if options["quit"] :     
     133            server.quitApplication() 
     134         
    54135if __name__ == "__main__" : 
    55136    retcode = 0 
     
    57138        defaults = { \ 
    58139                   } 
    59         short_options = "vh" 
    60         long_options = ["help", "version"] 
     140        short_options = "vhd:acnq" 
     141        long_options = ["help", "version", "destination=", \ 
     142                        "ask", "confirm", "notify", "quit" ] 
    61143         
    62144        # Initializes the command line tool 
     
    65147         
    66148        # parse and checks the command line 
    67         (options, args) = notifier.parseCommandline(sys.argv[1:], short_options, long_options, allownothing=1) 
     149        (options, args) = notifier.parseCommandline(sys.argv[1:], short_options, long_options) 
    68150         
    69151        # sets long options 
    70152        options["help"] = options["h"] or options["help"] 
    71153        options["version"] = options["v"] or options["version"] 
     154        options["destination"] = options["d"] or options["destination"] 
     155        options["ask"] = options["a"] or options["ask"] 
     156        options["confirm"] = options["c"] or options["confirm"] 
     157        options["notify"] = options["n"] or options["notify"] 
     158        options["quit"] = options["q"] or options["quit"] 
    72159         
    73160        if options["help"] : 
     
    75162        elif options["version"] : 
    76163            notifier.display_version_and_quit() 
     164        elif (options["ask"] and (options["confirm"] or options["notify"])) \ 
     165             or (options["confirm"] and (options["ask"] or options["notify"])) \ 
     166             or (options["notify"] and (options["ask"] or options["confirm"])) : 
     167            raise PyKotaCommandLineError, _("incompatible options, see help.") 
     168        elif (not options["destination"]) \ 
     169             or not (options["quit"] or options["ask"] or options["confirm"] or options["notify"]) : 
     170            raise PyKotaCommandLineError, _("some options are mandatory, see help.") 
     171        elif (not args) and (not options["quit"]) : 
     172            raise PyKotaCommandLineError, _("some options require arguments, see help.") 
    77173        else : 
    78174            retcode = notifier.main(args, options) 
  • pykota/trunk/man/de/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/el_GR/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/es/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/fr/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/it/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/nb_NO/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pl/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pt_BR/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/pt/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/sv_SE/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/th/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/tr/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/man/zh_TW/pknotify.1

    r2778 r2779  
    2020\fB\-h\fR | \fB\-\-help\fR 
    2121Prints this message then exits. 
     22.TP 
     23\fB\-d\fR | \fB\-\-destination\fR h[:p] 
     24Sets the destination hostname and optional 
     25port onto which contact the remote PyKotIcon 
     26application. This option is mandatory. 
     27When not specified, the port defaults to 7654. 
     28.TP 
     29\fB\-a\fR | \fB\-\-ask\fR 
     30Tells pknotify to ask something to the end 
     31user. Then pknotify will output the result. 
     32.TP 
     33\fB\-c\fR | \fB\-\-confirm\fR 
     34Tells pknotify to ask for either a confirmation 
     35or abortion. 
     36.TP 
     37\fB\-n\fR | \fB\-\-notify\fR 
     38Tells pknotify to send an informational message 
     39message to the end user. 
     40.TP 
     41\fB\-q\fR | \fB\-\-quit\fR 
     42Tells pknotify to send a message asking the 
     43PyKotIcon application to exit. This option can 
     44be combined with the other ones to make PyKotIcon 
     45exit after having sent the answer from the dialog. 
     46.IP 
     47You MUST specify either \fB\-\-ask\fR, \fB\-\-confirm\fR, \fB\-\-notify\fR or \fB\-\-quit\fR. 
     48.IP 
     49arguments : 
     50.HP 
     51\fB\-a\fR | \fB\-\-ask\fR : Several arguments are accepted, or the form 
     52.IP 
     53"label:varname:defaultvalue". The result will 
     54be printed to stdout in the following format : 
     55VAR1NAME=VAR1VALUE 
     56VAR2NAME=VAR2VALUE 
     57\&... 
     58If the dialog was cancelled, nothing will be 
     59printed. If one of the varname is 'password' 
     60then this field is asked as a password (you won't 
     61see what you type in). 
     62.TP 
     63\fB\-c\fR | \fB\-\-confirm\fR : A single argument is expected, representing the 
     64message to display. If the dialog is confirmed 
     65then pknotify will print OK, else CANCEL. 
     66.TP 
     67\fB\-n\fR | \fB\-\-notify\fR : A single argument is expected, representing the 
     68message to display. In this case pknotify will 
     69always print OK. 
     70.PP 
     71examples : 
     72.IP 
     73pknotify \fB\-d\fR client:7654 \fB\-\-confirm\fR "This job costs : 
     74.PP 
     7510 credits !" 
     76.IP 
     77would display the cost of a print job and asks for confirmation. 
    2278.PP 
    2379This program is free software; you can redistribute it and/or modify 
  • pykota/trunk/NEWS

    r2773 r2779  
    2222PyKota NEWS : 
    2323        
     24    - 1.24alpha16 (2006-03-02) : 
     25     
     26        - Introduced the pknotify command line tool to dialog 
     27          with remote PyKotIcon applications. 
     28           
    2429    - 1.24alpha15 (2006-03-02) : 
    2530         
  • pykota/trunk/pykota/version.py

    r2759 r2779  
    2222# 
    2323 
    24 __version__ = "1.24alpha15_unofficial" 
     24__version__ = "1.24alpha16_unofficial" 
    2525 
    2626__doc__ = "PyKota : a complete Printing Quota Solution for CUPS."