Index: pykota/trunk/bin/pkprinters
===================================================================
--- pykota/trunk/bin/pkprinters (revision 1452)
+++ pykota/trunk/bin/pkprinters (revision 1453)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.8  2004/05/06 20:30:24  jalet
+# Added --skipexisting command line option to pkprinters
+#
 # Revision 1.7  2004/05/06 12:51:58  jalet
 # Documentation
@@ -69,6 +72,6 @@
   
   -a | --add           Adds printers if they don't exist on the Quota 
-                       Storage Server. Doesn't modify any already
-                       existing printer.
+                       Storage Server. If they exist, they are modified
+                       unless -s|--skipexisting is also used.
                        
   -d | --delete        Deletes printers from the quota storage.
@@ -99,4 +102,7 @@
   -r | --remove        In combination with the --groups option above,                       
                        remove printers from the specified printers groups.
+                       
+  -s | --skipexisting  In combination with the --add option above, tells
+                       pkprinters to not modify existing printers.
   
   printer1 through printerN can contain wildcards if the --add option 
@@ -173,5 +179,9 @@
                 printer = self.storage.getPrinter(pname)
                 if printer.Exists :
-                    self.logger.log_message(_("Printer %s already exists, skipping.") % printer.Name, "warn")
+                    if options["skipexisting"] :
+                        self.logger.log_message(_("Printer %s already exists, skipping.") % printer.Name, "warn")
+                    else :    
+                        self.logger.log_message(_("Printer %s already exists, will be modified.") % printer.Name, "warn")
+                        printers.append(printer)
                 else :
                     if self.isValidName(pname) :
@@ -211,6 +221,6 @@
     retcode = 0
     try :
-        short_options = "hvac:dg:lr"
-        long_options = ["help", "version", "add", "charge=", "delete", "groups=", "list", "remove"]
+        short_options = "hvac:dg:lrs"
+        long_options = ["help", "version", "add", "charge=", "delete", "groups=", "list", "remove", "skipexisting"]
         
         # Initializes the command line tool
@@ -229,4 +239,5 @@
         options["list"] = options["l"] or options["list"]
         options["remove"] = options["r"] or options["remove"]
+        options["skipexisting"] = options["s"] or options["skipexisting"]
         
         if options["help"] :
@@ -235,4 +246,5 @@
             manager.display_version_and_quit()
         elif (options["delete"] and (options["add"] or options["groups"] or options["charge"] or options["remove"])) \
+           or (options["skipexisting"] and not options["add"]) \
            or (options["list"] and (options["add"] or options["delete"] or options["groups"] or options["charge"] or options["remove"])) :
             raise PyKotaToolError, _("incompatible options, see help.")
Index: pykota/trunk/man/pkprinters.1
===================================================================
--- pykota/trunk/man/pkprinters.1 (revision 1452)
+++ pykota/trunk/man/pkprinters.1 (revision 1453)
@@ -21,6 +21,6 @@
 \fB\-a\fR | \fB\-\-add\fR
 Adds printers if they don't exist on the Quota
-Storage Server. Doesn't modify any already
-existing printer.
+Storage Server. If they exist, they are modified
+unless \fB\-s\fR|--skipexisting is also used.
 .TP
 \fB\-d\fR | \fB\-\-delete\fR
@@ -55,4 +55,8 @@
 In combination with the \fB\-\-groups\fR option above,
 remove printers from the specified printers groups.
+.TP
+\fB\-s\fR | \fB\-\-skipexisting\fR
+In combination with the \fB\-\-add\fR option above, tells
+pkprinters to not modify existing printers.
 .IP
 printer1 through printerN can contain wildcards if the \fB\-\-add\fR option
Index: pykota/trunk/NEWS
===================================================================
--- pykota/trunk/NEWS (revision 1451)
+++ pykota/trunk/NEWS (revision 1453)
@@ -24,6 +24,8 @@
     - 1.19alpha5 :
     
-        - pkprinters --add now completely skips existing printers, but
-          logs a warning.
+        - pkprinters --skipexisting now tells pkprinters to not
+          modify existing printers when --add is used.
+          pkprinters logs a warning message whenever --add is
+          used and a printer already exists.
           
     - 1.19alpha4 :
Index: pykota/trunk/po/en/pykota.po
===================================================================
--- pykota/trunk/po/en/pykota.po (revision 1451)
+++ pykota/trunk/po/en/pykota.po (revision 1453)
@@ -451,2 +451,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/br/pykota.po
===================================================================
--- pykota/trunk/po/br/pykota.po (revision 1451)
+++ pykota/trunk/po/br/pykota.po (revision 1453)
@@ -487,2 +487,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/pt/pykota.po
===================================================================
--- pykota/trunk/po/pt/pykota.po (revision 1451)
+++ pykota/trunk/po/pt/pykota.po (revision 1453)
@@ -487,2 +487,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/es/pykota.po
===================================================================
--- pykota/trunk/po/es/pykota.po (revision 1451)
+++ pykota/trunk/po/es/pykota.po (revision 1453)
@@ -491,2 +491,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/fr/pykota.po
===================================================================
--- pykota/trunk/po/fr/pykota.po (revision 1451)
+++ pykota/trunk/po/fr/pykota.po (revision 1453)
@@ -478,2 +478,6 @@
 msgstr "L'imprimante %s existe d�, ignor�"
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr "L'imprimante %s existe d�, elle sera modifi�"
+
Index: pykota/trunk/po/se/pykota.po
===================================================================
--- pykota/trunk/po/se/pykota.po (revision 1451)
+++ pykota/trunk/po/se/pykota.po (revision 1453)
@@ -483,2 +483,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/pykota.pot
===================================================================
--- pykota/trunk/po/pykota.pot (revision 1451)
+++ pykota/trunk/po/pykota.pot (revision 1453)
@@ -451,2 +451,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
Index: pykota/trunk/po/it/pykota.po
===================================================================
--- pykota/trunk/po/it/pykota.po (revision 1451)
+++ pykota/trunk/po/it/pykota.po (revision 1453)
@@ -484,2 +484,6 @@
 msgstr ""
 
+#, python-format
+msgid "Printer %s already exists, will be modified."
+msgstr ""
+
