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

Doesn't set TEASTATUS when a prehook cancels the job

Files:
1 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")