Changeset 3549 for pykota/trunk/bin/pkprinters
- Timestamp:
- 08/18/10 04:20:57 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkprinters
r3489 r3549 50 50 printer.setPassThrough(True) 51 51 if maxjobsize is not None : 52 printer.setMaxJobSize(maxjobsize) 52 if maxjobsize == "unlimited" : 53 printer.setMaxJobSize(None) 54 else : 55 printer.setMaxJobSize(maxjobsize) 53 56 54 57 def managePrintersGroups(self, pgroups, printer, remove) : … … 151 154 (_("Passthrough mode : %s") % ((printer.PassThrough and _("ON")) or _("OFF")))) 152 155 self.display(" %s\n" % \ 153 (_("Maximum job size : %s") % (( printer.MaxJobSizeand (_("%s pages") % printer.MaxJobSize)) or _("Unlimited"))))156 (_("Maximum job size : %s") % (((printer.MaxJobSize is not None) and (_("%s pages") % printer.MaxJobSize)) or _("Unlimited")))) 154 157 self.display(" %s\n" % (_("Routed through PyKota : %s") % ((self.isPrinterCaptured(printer.Name) and _("YES")) or _("NO")))) 155 158 if parents : … … 188 191 189 192 if options.maxjobsize : 190 try : 191 maxjobsize = int(options.maxjobsize) 192 if maxjobsize < 0 : 193 raise ValueError 194 except ValueError : 195 raise PyKotaCommandLineError, _("Invalid maximum job size value %s") % options.maxjobsize 193 if options.maxjobsize.lower() == "unlimited" : 194 maxjobsize = "unlimited" 195 else : 196 try : 197 maxjobsize = int(options.maxjobsize) 198 if maxjobsize < 0 : 199 raise ValueError 200 except ValueError : 201 raise PyKotaCommandLineError, _("Invalid maximum job size value %s") % options.maxjobsize 196 202 else : 197 203 maxjobsize = None … … 306 312 parser.add_option("-m", "--maxjobsize", 307 313 dest="maxjobsize", 308 help=_("Set the maximum job size in pages allowed on the specified printers. "))314 help=_("Set the maximum job size in pages allowed on the specified printers. Accepted values are '0' to forbid printing, 'unlimited' to allow unrestricted printing, or any positive integer value.")) 309 315 parser.add_option("-n", "--nopassthrough", 310 316 action="store_true",