Changeset 1453

Show
Ignore:
Timestamp:
05/06/04 22:30:26 (20 years ago)
Author:
jalet
Message:

Added --skipexisting command line option to pkprinters

Location:
pykota/trunk
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkprinters

    r1452 r1453  
    2424# 
    2525# $Log$ 
     26# Revision 1.8  2004/05/06 20:30:24  jalet 
     27# Added --skipexisting command line option to pkprinters 
     28# 
    2629# Revision 1.7  2004/05/06 12:51:58  jalet 
    2730# Documentation 
     
    6972   
    7073  -a | --add           Adds printers if they don't exist on the Quota  
    71                        Storage Server. Doesn't modify any already 
    72                        existing printer. 
     74                       Storage Server. If they exist, they are modified 
     75                       unless -s|--skipexisting is also used. 
    7376                        
    7477  -d | --delete        Deletes printers from the quota storage. 
     
    99102  -r | --remove        In combination with the --groups option above,                        
    100103                       remove printers from the specified printers groups. 
     104                        
     105  -s | --skipexisting  In combination with the --add option above, tells 
     106                       pkprinters to not modify existing printers. 
    101107   
    102108  printer1 through printerN can contain wildcards if the --add option  
     
    173179                printer = self.storage.getPrinter(pname) 
    174180                if printer.Exists : 
    175                     self.logger.log_message(_("Printer %s already exists, skipping.") % printer.Name, "warn") 
     181                    if options["skipexisting"] : 
     182                        self.logger.log_message(_("Printer %s already exists, skipping.") % printer.Name, "warn") 
     183                    else :     
     184                        self.logger.log_message(_("Printer %s already exists, will be modified.") % printer.Name, "warn") 
     185                        printers.append(printer) 
    176186                else : 
    177187                    if self.isValidName(pname) : 
     
    211221    retcode = 0 
    212222    try : 
    213         short_options = "hvac:dg:lr" 
    214         long_options = ["help", "version", "add", "charge=", "delete", "groups=", "list", "remove"] 
     223        short_options = "hvac:dg:lrs" 
     224        long_options = ["help", "version", "add", "charge=", "delete", "groups=", "list", "remove", "skipexisting"] 
    215225         
    216226        # Initializes the command line tool 
     
    229239        options["list"] = options["l"] or options["list"] 
    230240        options["remove"] = options["r"] or options["remove"] 
     241        options["skipexisting"] = options["s"] or options["skipexisting"] 
    231242         
    232243        if options["help"] : 
     
    235246            manager.display_version_and_quit() 
    236247        elif (options["delete"] and (options["add"] or options["groups"] or options["charge"] or options["remove"])) \ 
     248           or (options["skipexisting"] and not options["add"]) \ 
    237249           or (options["list"] and (options["add"] or options["delete"] or options["groups"] or options["charge"] or options["remove"])) : 
    238250            raise PyKotaToolError, _("incompatible options, see help.") 
  • pykota/trunk/man/pkprinters.1

    r1452 r1453  
    2121\fB\-a\fR | \fB\-\-add\fR 
    2222Adds printers if they don't exist on the Quota 
    23 Storage Server. Doesn't modify any already 
    24 existing printer. 
     23Storage Server. If they exist, they are modified 
     24unless \fB\-s\fR|--skipexisting is also used. 
    2525.TP 
    2626\fB\-d\fR | \fB\-\-delete\fR 
     
    5555In combination with the \fB\-\-groups\fR option above, 
    5656remove printers from the specified printers groups. 
     57.TP 
     58\fB\-s\fR | \fB\-\-skipexisting\fR 
     59In combination with the \fB\-\-add\fR option above, tells 
     60pkprinters to not modify existing printers. 
    5761.IP 
    5862printer1 through printerN can contain wildcards if the \fB\-\-add\fR option 
  • pykota/trunk/NEWS

    r1451 r1453  
    2424    - 1.19alpha5 : 
    2525     
    26         - pkprinters --add now completely skips existing printers, but 
    27           logs a warning. 
     26        - pkprinters --skipexisting now tells pkprinters to not 
     27          modify existing printers when --add is used. 
     28          pkprinters logs a warning message whenever --add is 
     29          used and a printer already exists. 
    2830           
    2931    - 1.19alpha4 : 
  • pykota/trunk/po/br/pykota.po

    r1451 r1453  
    487487msgstr "" 
    488488 
     489#, python-format 
     490msgid "Printer %s already exists, will be modified." 
     491msgstr "" 
     492 
  • pykota/trunk/po/en/pykota.po

    r1451 r1453  
    451451msgstr "" 
    452452 
     453#, python-format 
     454msgid "Printer %s already exists, will be modified." 
     455msgstr "" 
     456 
  • pykota/trunk/po/es/pykota.po

    r1451 r1453  
    491491msgstr "" 
    492492 
     493#, python-format 
     494msgid "Printer %s already exists, will be modified." 
     495msgstr "" 
     496 
  • pykota/trunk/po/fr/pykota.po

    r1451 r1453  
    478478msgstr "L'imprimante %s existe d�, ignor�" 
    479479 
     480#, python-format 
     481msgid "Printer %s already exists, will be modified." 
     482msgstr "L'imprimante %s existe d�, elle sera modifi�" 
     483 
  • pykota/trunk/po/it/pykota.po

    r1451 r1453  
    484484msgstr "" 
    485485 
     486#, python-format 
     487msgid "Printer %s already exists, will be modified." 
     488msgstr "" 
     489 
  • pykota/trunk/po/pt/pykota.po

    r1451 r1453  
    487487msgstr "" 
    488488 
     489#, python-format 
     490msgid "Printer %s already exists, will be modified." 
     491msgstr "" 
     492 
  • pykota/trunk/po/pykota.pot

    r1451 r1453  
    451451msgstr "" 
    452452 
     453#, python-format 
     454msgid "Printer %s already exists, will be modified." 
     455msgstr "" 
     456 
  • pykota/trunk/po/se/pykota.po

    r1451 r1453  
    483483msgstr "" 
    484484 
     485#, python-format 
     486msgid "Printer %s already exists, will be modified." 
     487msgstr "" 
     488