Changeset 602

Show
Ignore:
Timestamp:
03/21/05 14:25:27 (20 years ago)
Author:
jerome
Message:

Doesn't set TEASTATUS when a prehook cancels the job

Location:
tea4cups/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • tea4cups/trunk/tea4cups

    r601 r602  
    227227        """Initializes the CUPS backend wrapper.""" 
    228228        self.gotSigTerm = 0 
     229        self.isCancelled = 0    # did a prehook cancel the print job ? 
    229230        signal.signal(signal.SIGTERM, signal.SIG_IGN) 
    230231        signal.signal(signal.SIGPIPE, signal.SIG_IGN) 
     
    538539            if status : 
    539540                exitcode = status 
    540             if (branchtype == "prehook") and (os.environ.get("TEASTATUS", "") == "CANCELLED") : 
     541            if (branchtype == "prehook") and self.isCancelled : 
    541542                break # We don't want to execute tees or posthooks in this case 
    542543        signal.signal(signal.SIGTERM, signal.SIG_IGN) 
     
    571572                    if (btype == "prehook") and (retcode == 255) : # -1 
    572573                        self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 
    573                         os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode 
     574                        self.isCancelled = 1 
    574575                    else :     
    575576                        self.logInfo("%s %s on printer %s didn't exit successfully." % (btypetitle, branch, self.PrinterName), "error") 
     
    609610                    if (btype == "prehook") and (retcode == 255) : # -1 
    610611                        self.logInfo("Job %s cancelled by prehook %s" % (self.JobId, branch)) 
    611                         os.environ["TEASTATUS"] = "CANCELLED" # and don't touch exitcode 
     612                        self.isCancelled = 1 
    612613                    else :     
    613614                        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  
    109109# 
    110110# 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. 
     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. 
    114114#  
    115115