Changeset 602
- Timestamp:
- 03/21/05 14:25:27 (20 years ago)
- Location:
- tea4cups/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
tea4cups/trunk/tea4cups
r601 r602 227 227 """Initializes the CUPS backend wrapper.""" 228 228 self.gotSigTerm = 0 229 self.isCancelled = 0 # did a prehook cancel the print job ? 229 230 signal.signal(signal.SIGTERM, signal.SIG_IGN) 230 231 signal.signal(signal.SIGPIPE, signal.SIG_IGN) … … 538 539 if status : 539 540 exitcode = status 540 if (branchtype == "prehook") and (os.environ.get("TEASTATUS", "") == "CANCELLED"):541 if (branchtype == "prehook") and self.isCancelled : 541 542 break # We don't want to execute tees or posthooks in this case 542 543 signal.signal(signal.SIGTERM, signal.SIG_IGN) … … 571 572 if (btype == "prehook") and (retcode == 255) : # -1 572 573 self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 573 os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode574 self.isCancelled = 1 574 575 else : 575 576 self.logInfo("%s %s on printer %s didn't exit successfully." % (btypetitle, branch, self.PrinterName), "error") … … 609 610 if (btype == "prehook") and (retcode == 255) : # -1 610 611 self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 611 os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode612 self.isCancelled = 1 612 613 else : 613 614 self.logInfo("%s %s (PID %s) on printer %s didn't exit successfully." % (btypetitle, branch, childpid, self.PrinterName), "error") -
tea4cups/trunk/tea4cups.conf
r601 r602 109 109 # 110 110 # NB : as a special feature, any prehook which exits with a -1 status (255) 111 # causes the job to NOT be sent to the real backend, in which case TEASTATUS112 # value is the string CANCELLED. None of the tees and posthooks gets executed113 # in this case, but allremaining prehooks are still executed.111 # causes the job to NOT be sent to the real backend, effectively cancelling it. 112 # None of the tees and posthooks gets executed in this case, but all 113 # remaining prehooks are still executed. 114 114 # 115 115