Changeset 1584 for pykota/trunk/bin
- Timestamp:
- 07/01/04 21:56:43 (20 years ago)
- Location:
- pykota/trunk/bin
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r1562 r1584 24 24 # 25 25 # $Log$ 26 # Revision 1.66 2004/07/01 19:56:25 jalet 27 # Better dispatching of error messages 28 # 26 29 # Revision 1.65 2004/06/22 09:31:17 jalet 27 30 # Always send some debug info to CUPS' back channel stream (stderr) as … … 381 384 # we deny the job in this case (nothing to print anyway) 382 385 if not self.jobSizeBytes : 383 self. logger.log_message(_("Job contains no data. Printing is denied."), "warn")386 self.printInfo(_("Job contains no data. Printing is denied."), "warn") 384 387 action = "DENY" 385 388 … … 446 449 pollobj.unregister(fileno) 447 450 except KeyError : 448 self. logger.log_message(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn")451 self.printInfo(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn") 449 452 except : 450 453 self.logdebug("Error while unregistering file number %s from polling object." % fileno) … … 471 474 def sendBackChannelData(self, message) : 472 475 """Sends an informational message to CUPS via back channel stream (stderr).""" 473 sys.stderr.write("INFO: PyKota (PID %s) : %s\n" % (os.getpid(), message.strip())) 474 sys.stderr.flush() 476 self.printInfo("PyKota (PID %s) : %s" % (os.getpid(), message.strip())) 475 477 476 478 def handleData(self) : … … 651 653 retcode = os.WEXITSTATUS(status) 652 654 elif not killed : 653 self. logger.log_message(_("CUPS backend %s died abnormally.") % realbackend, "error")655 self.printInfo(_("CUPS backend %s died abnormally.") % realbackend, "error") 654 656 retcode = -1 655 657 else : -
pykota/trunk/bin/edpykota
r1546 r1584 24 24 # 25 25 # $Log$ 26 # Revision 1.76 2004/07/01 19:56:40 jalet 27 # Better dispatching of error messages 28 # 26 29 # Revision 1.75 2004/06/18 13:34:47 jalet 27 30 # Now all tracebacks include PyKota's version number … … 463 466 if (softlimit is not None) and (hardlimit is not None) and (hardlimit < softlimit) : 464 467 # error, exchange them 465 self. logger.log_message(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit))468 self.printInfo(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit)) 466 469 (softlimit, hardlimit) = (hardlimit, softlimit) 467 470 … … 541 544 protoquota = getattr(self.storage, "get%sPQuota" % suffix)(protoentry, printer) 542 545 if not protoquota.Exists : 543 self. logger.log_message(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name))546 self.printInfo(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name)) 544 547 continue # skip this printer 545 548 else : 546 549 (softlimit, hardlimit) = (protoquota.SoftLimit, protoquota.HardLimit) 547 550 else : 548 self. logger.log_message(_("Prototype object %s not found in Quota Storage.") % protoentry.Name)551 self.printInfo(_("Prototype object %s not found in Quota Storage.") % protoentry.Name) 549 552 550 553 if not options["noquota"] : … … 552 555 hardlimit = softlimit 553 556 if hardlimit is not None : 554 self. logger.log_message(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name))557 self.printInfo(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name)) 555 558 if softlimit is None : 556 559 softlimit = hardlimit 557 560 if softlimit is not None : 558 self. logger.log_message(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name))561 self.printInfo(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name)) 559 562 560 563 if options["add"] : … … 568 571 (name, email) = splitname 569 572 if email and (email.count('@') != 1) : 570 self. logger.log_message(_("Invalid email address %s") % email)573 self.printInfo(_("Invalid email address %s") % email) 571 574 email = "" 572 575 entry = getattr(self.storage, "get%s" % suffix)(name) … … 595 598 else : 596 599 if options["groups"] : 597 self. logger.log_message(_("Invalid group name %s") % entry.Name)600 self.printInfo(_("Invalid group name %s") % entry.Name) 598 601 else : 599 self. logger.log_message(_("Invalid user name %s") % entry.Name)602 self.printInfo(_("Invalid user name %s") % entry.Name) 600 603 elif options["delete"] : 601 604 todelete[entry.Name] = entry … … 607 610 608 611 if not entrypquota.Exists : 609 self. logger.log_message(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name))612 self.printInfo(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name)) 610 613 else : 611 614 if options["noquota"] or options["prototype"] or ((softlimit is not None) and (hardlimit is not None)) : … … 640 643 changed[entry.Name]["ingroups"].append(groupname) 641 644 else : 642 self. logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname)645 self.printInfo(_("Group %s not found in the PyKota Storage.") % groupname) 643 646 644 647 # This line disabled to prevent sending of unwanted email -
pykota/trunk/bin/pkhint
r1579 r1584 24 24 # 25 25 # $Log$ 26 # Revision 1.14 2004/07/01 19:56:40 jalet 27 # Better dispatching of error messages 28 # 26 29 # Revision 1.13 2004/06/29 07:55:18 jalet 27 30 # Doesn't output the warning message when --help or --version is asked … … 226 229 device = self.extractDeviceFromURI(deviceuri) 227 230 if devicetype is None : 228 s ys.stderr.write("Unknown device %s for printer %s\n"% (device, printer))231 self.printInfo(_("Unknown device %s for printer %s") % (device, printer)) 229 232 elif devicetype == "network" : 230 233 try : … … 245 248 else : 246 249 configuration.append((printer, "software(/usr/bin/pkpgcounter)")) 247 # elif devicetype == "direct" :248 # sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))249 #elif devicetype == "serial" :250 # sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))251 #else :252 # sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))253 250 else : 254 251 configuration.append((printer, "software(/usr/bin/pkpgcounter)")) -
pykota/trunk/bin/pkprinters
r1582 r1584 24 24 # 25 25 # $Log$ 26 # Revision 1.13 2004/07/01 19:56:41 jalet 27 # Better dispatching of error messages 28 # 26 29 # Revision 1.12 2004/07/01 17:45:47 jalet 27 30 # Added code to handle the description field for printers … … 197 200 if printer.Exists : 198 201 if options["skipexisting"] : 199 self.print Error(_("Printer %s already exists, skipping.") % printer.Name)202 self.printInfo(_("Printer %s already exists, skipping.") % printer.Name) 200 203 else : 201 self.print Error(_("Printer %s already exists, will be modified.") % printer.Name)204 self.printInfo(_("Printer %s already exists, will be modified.") % printer.Name) 202 205 printers.append(printer) 203 206 else : -
pykota/trunk/bin/pykotme
r1546 r1584 24 24 # 25 25 # $Log$ 26 # Revision 1.13 2004/07/01 19:56:42 jalet 27 # Better dispatching of error messages 28 # 26 29 # Revision 1.12 2004/06/18 13:34:49 jalet 27 30 # Now all tracebacks include PyKota's version number … … 151 154 totalsize += parser.getJobSize() 152 155 except PDLAnalyzerError, msg : 153 sys.stderr.write("%s\n" % msg) 154 sys.stderr.flush() 156 self.printInfo(msg) 155 157 156 158 # get current user