Changeset 1437

Show
Ignore:
Timestamp:
04/16/04 18:47:58 (21 years ago)
Author:
jalet
Message:

pkprinters now accept the --list command line option

Location:
pykota/trunk
Files:
19 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkprinters

    r1332 r1437  
    2424# 
    2525# $Log$ 
     26# Revision 1.4  2004/04/16 16:47:57  jalet 
     27# pkprinters now accept the --list command line option 
     28# 
    2629# Revision 1.3  2004/02/04 13:24:41  jalet 
    2730# pkprinters can now remove printers from printers groups. 
     
    8083                       printer groups. 
    8184                        
     85  -l | --list          List informations about the printer(s) and the 
     86                       printers groups it is a member of. 
     87                        
    8288  -r | --remove        In combination with the --groups option above,                        
    8389                       remove printers from the specified printers groups. 
     
    130136    def main(self, names, options) : 
    131137        """Manage printers.""" 
     138        if options["list"] and not names : 
     139            names = ["*"] 
     140             
    132141        if options["groups"] :         
    133142            printersgroups = self.storage.getMatchingPrinters(options["groups"]) 
     
    167176            if options["delete"] : 
    168177                printer.delete() 
     178            elif options["list"] :     
     179                parents = ", ".join([p.Name for p in self.storage.getParentPrinters(printer)]) 
     180                if parents :  
     181                    parents = "%s %s" % (_("in"), parents) 
     182                print "%s (%s + %s) %s" % \ 
     183                      (printer.Name, printer.PricePerJob, \ 
     184                       printer.PricePerPage, parents) 
    169185            else :     
    170186                if options["charge"] : 
     
    180196    retcode = 0 
    181197    try : 
    182         short_options = "hvac:dg:r" 
    183         long_options = ["help", "version", "add", "charge=", "delete", "groups=", "remove"] 
     198        short_options = "hvac:dg:lr" 
     199        long_options = ["help", "version", "add", "charge=", "delete", "groups=", "list", "remove"] 
    184200         
    185201        # Initializes the command line tool 
     
    196212        options["delete"] = options["d"] or options["delete"]  
    197213        options["groups"] = options["g"] or options["groups"] 
     214        options["list"] = options["l"] or options["list"] 
    198215        options["remove"] = options["r"] or options["remove"] 
    199216         
     
    202219        elif options["version"] : 
    203220            manager.display_version_and_quit() 
    204         elif options["delete"] and (options["add"] or options["groups"] or options["charge"] or options["remove"]) :     
     221        elif (options["delete"] and (options["add"] or options["groups"] or options["charge"] or options["remove"])) \ 
     222           or (options["list"] and (options["add"] or options["delete"] or options["groups"] or options["charge"] or options["remove"])) : 
    205223            raise PyKotaToolError, _("incompatible options, see help.") 
    206224        elif options["remove"] and not options["groups"] :     
    207225            raise PyKotaToolError, _("You have to pass printer groups names on the command line") 
    208         elif not args :     
     226        elif (not args) and (not options["list"]) :     
    209227            raise PyKotaToolError, _("You have to pass printer names on the command line") 
    210228        else : 
  • pykota/trunk/man/edpykota.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH EDPYKOTA "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH EDPYKOTA "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 edpykota \- manual page for edpykota 1.18_unofficial 
     4edpykota \- manual page for edpykota 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 edpykota v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6edpykota v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77A Print Quota editor for PyKota. 
    88.PP 
     
    8181by its account balance or by its page quota. 
    8282The default value is 'quota'. Allowed values 
    83 are 'quota' and 'balance'. 
     83are 'quota' 'balance' 'quota-then-balance' and 
     84\&'balance-then-quota'. 
     85WARNING : quota-then-balance and balance-then-quota 
     86are not yet implemented. 
    8487.TP 
    8588\fB\-b\fR | \fB\-\-balance\fR b 
  • pykota/trunk/man/pkhint.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH PKHINT "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH PKHINT "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 pkhint \- manual page for pkhint 1.18_unofficial 
     4pkhint \- manual page for pkhint 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 pkhint v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6pkhint v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77A tool to give hints on what accounting method is best for each printer. 
    88.PP 
  • pykota/trunk/man/pkprinters.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH PKPRINTERS "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH PKPRINTERS "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 pkprinters \- manual page for pkprinters 1.18_unofficial 
     4pkprinters \- manual page for pkprinters 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 pkprinters v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6pkprinters v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77A Printers Manager for PyKota. 
    88.PP 
     
    4646default action is to add printers to the specified 
    4747printer groups. 
     48.TP 
     49\fB\-l\fR | \fB\-\-list\fR 
     50List informations about the printer(s) and all 
     51the printers groups it is a member of. 
    4852.TP 
    4953\fB\-r\fR | \fB\-\-remove\fR 
  • pykota/trunk/man/pykotme.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH PYKOTME "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH PYKOTME "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 pykotme \- manual page for pykotme 1.18_unofficial 
     4pykotme \- manual page for pykotme 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 pykotme v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6pykotme v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77.PP 
    88Gives print quotes to users. 
  • pykota/trunk/man/repykota.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH REPYKOTA "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH REPYKOTA "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 repykota \- manual page for repykota 1.18_unofficial 
     4repykota \- manual page for repykota 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 repykota v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6repykota v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77.PP 
    88Generates print quota reports. 
  • pykota/trunk/man/warnpykota.1

    r1414 r1437  
    11.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.33. 
    2 .TH WARNPYKOTA "1" "March 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
     2.TH WARNPYKOTA "1" "April 2004" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 
    33.SH NAME 
    4 warnpykota \- manual page for warnpykota 1.18_unofficial 
     4warnpykota \- manual page for warnpykota 1.19alpha2_unofficial 
    55.SH DESCRIPTION 
    6 warnpykota v1.18_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
     6warnpykota v1.19alpha2_unofficial (c) 2003-2004 C@LL - Conseil Internet & Logiciels Libres 
    77.PP 
    88Sends mail to users over print quota. 
  • pykota/trunk/NEWS

    r1430 r1437  
    2222PyKota NEWS : 
    2323 
     24    - 1.19alpha3 : 
     25     
     26        - pkprinters now accepts the --list command line argument 
     27          to list informations about printers. 
     28           
    2429    - 1.19alpha2 : 
    2530     
  • pykota/trunk/po/br/pykota.po

    r1413 r1437  
    479479msgstr "Problema modificando entrada LDAP (%s, %s)" 
    480480 
     481#, python-format 
     482msgid "in" 
     483msgstr "em" 
  • pykota/trunk/po/en/pykota.po

    r1413 r1437  
    442442msgid "Problem modifying LDAP entry (%s, %s)" 
    443443msgstr "" 
     444 
     445#, python-format 
     446msgid "in" 
     447msgstr "" 
  • pykota/trunk/po/es/pykota.po

    r1413 r1437  
    483483msgstr "Problema al modificar entrada LDAP (%s, %s)" 
    484484 
     485#, python-format 
     486msgid "in" 
     487msgstr "en" 
  • pykota/trunk/po/fr/pykota.po

    r1413 r1437  
    470470msgstr "Probl� durant la modification de l'entr�LDAP (%s, %s)" 
    471471 
     472#, python-format 
     473msgid "in" 
     474msgstr "dans" 
  • pykota/trunk/po/pt/pykota.po

    r1413 r1437  
    479479msgstr "Ocorreu um problema ao modificar a entrada LDAP (%s, %s)" 
    480480 
     481#, python-format 
     482msgid "in" 
     483msgstr "em" 
  • pykota/trunk/po/pykota.pot

    r1413 r1437  
    442442msgid "Problem modifying LDAP entry (%s, %s)" 
    443443msgstr "" 
     444 
     445#, python-format 
     446msgid "in" 
     447msgstr "" 
  • pykota/trunk/pykota/version.py

    r1430 r1437  
    2222# 
    2323 
    24 __version__ = "1.19alpha2_unofficial" 
     24__version__ = "1.19alpha3_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""