- Timestamp:
- 03/21/05 14:20:51 (20 years ago)
- Location:
- tea4cups/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
tea4cups/trunk/tea4cups
r600 r601 37 37 from struct import unpack 38 38 39 version = " 1.5alpha"39 version = "2.00" 40 40 41 41 class TeeError(Exception): … … 538 538 if status : 539 539 exitcode = status 540 if (branchtype == "prehook") and (os.environ.get("TEASTATUS", "") == "CANCELLED") : 541 break # We don't want to execute tees or posthooks in this case 540 542 signal.signal(signal.SIGTERM, signal.SIG_IGN) 541 543 if not exitcode : … … 567 569 retcode = os.WEXITSTATUS(retcode) 568 570 if retcode : 569 self.logInfo("%s %s on printer %s didn't exit successfully." % (btypetitle, branch, self.PrinterName), "error") 570 exitcode = 1 571 if (btype == "prehook") and (retcode == 255) : # -1 572 self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 573 os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode 574 else : 575 self.logInfo("%s %s on printer %s didn't exit successfully." % (btypetitle, branch, self.PrinterName), "error") 576 exitcode = 1 571 577 self.logDebug("End serialized %ss" % btypetitle) 572 578 else : … … 601 607 retcode = os.WEXITSTATUS(retcode) 602 608 if retcode : 603 self.logInfo("%s %s (PID %s) on printer %s didn't exit successfully." % (btypetitle, branch, childpid, self.PrinterName), "error") 604 exitcode = 1 609 if (btype == "prehook") and (retcode == 255) : # -1 610 self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 611 os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode 612 else : 613 self.logInfo("%s %s (PID %s) on printer %s didn't exit successfully." % (btypetitle, branch, childpid, self.PrinterName), "error") 614 exitcode = 1 605 615 if branch == "Original backend" : 606 616 os.environ["TEASTATUS"] = str(retcode) -
tea4cups/trunk/tea4cups.conf
r598 r601 107 107 # prehook_0 : echo "Your print job has been accepted" | smbclient -M $TEAUSERNAME 108 108 # posthook_0 : echo "Your print job has been printed with status $TEASTATUS" | smbclient -M $TEAUSERNAME 109 # 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 TEASTATUS 112 # value is the string CANCELLED. None of the tees and posthooks gets executed 113 # in this case, but all remaining prehooks are still executed. 114 # 109 115 110 116