Changeset 1453 for pykota/trunk/bin/pkprinters
- Timestamp:
- 05/06/04 22:30:26 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkprinters
r1452 r1453 24 24 # 25 25 # $Log$ 26 # Revision 1.8 2004/05/06 20:30:24 jalet 27 # Added --skipexisting command line option to pkprinters 28 # 26 29 # Revision 1.7 2004/05/06 12:51:58 jalet 27 30 # Documentation … … 69 72 70 73 -a | --add Adds printers if they don't exist on the Quota 71 Storage Server. Doesn't modify any already72 existing printer.74 Storage Server. If they exist, they are modified 75 unless -s|--skipexisting is also used. 73 76 74 77 -d | --delete Deletes printers from the quota storage. … … 99 102 -r | --remove In combination with the --groups option above, 100 103 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. 101 107 102 108 printer1 through printerN can contain wildcards if the --add option … … 173 179 printer = self.storage.getPrinter(pname) 174 180 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) 176 186 else : 177 187 if self.isValidName(pname) : … … 211 221 retcode = 0 212 222 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"] 215 225 216 226 # Initializes the command line tool … … 229 239 options["list"] = options["l"] or options["list"] 230 240 options["remove"] = options["r"] or options["remove"] 241 options["skipexisting"] = options["s"] or options["skipexisting"] 231 242 232 243 if options["help"] : … … 235 246 manager.display_version_and_quit() 236 247 elif (options["delete"] and (options["add"] or options["groups"] or options["charge"] or options["remove"])) \ 248 or (options["skipexisting"] and not options["add"]) \ 237 249 or (options["list"] and (options["add"] or options["delete"] or options["groups"] or options["charge"] or options["remove"])) : 238 250 raise PyKotaToolError, _("incompatible options, see help.")