Changeset 615
- Timestamp:
- 03/31/05 00:05:34 (20 years ago)
- Location:
- tea4cups/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
tea4cups/trunk/NEWS
r611 r615 22 22 Tea4CUPS News : 23 23 24 * 2.10 : 25 26 - Makes the IPP message filename and the Job's billing code available. 27 24 28 * 2.00 : 25 29 -
tea4cups/trunk/README
r612 r615 66 66 TEAOPTIONS : Options of the print job. 67 67 TEAINPUTFILE : Print job's data file or empty when job read from stdin. 68 TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps) 69 TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????) 68 70 TEASTATUS : Original CUPS backend's exit code : ONLY AVAILABLE FROM 69 71 posthooks, obviously. -
tea4cups/trunk/tea4cups
r614 r615 37 37 from struct import unpack 38 38 39 version = "2. 01alpha1_unofficial"39 version = "2.10_unofficial" 40 40 41 41 class TeeError(Exception): … … 415 415 self.Directory = self.getPrintQueueOption(self.PrinterName, "directory") 416 416 self.DataFile = os.path.join(self.Directory, "%s-%s-%s-%s" % (self.myname, self.PrinterName, self.UserName, self.JobId)) 417 self.ClientHost = self.extractJobOriginatingHostName() 417 (ippfilename, ippmessage) = self.parseIPPMessageFile() 418 self.ControlFile = ippfilename 419 self.ClientHost = ippmessage.get("job-originating-host-name") 420 self.JobBilling = ippmessage.get("job-billing") 418 421 419 422 def getCupsConfigDirectives(self, directives=[]) : … … 444 447 return dirvalues 445 448 446 def extractJobOriginatingHostName(self) :449 def parseIPPMessageFile(self) : 447 450 """Extracts the client's hostname or IP address from the CUPS message file for current job.""" 448 451 cupsdconf = self.getCupsConfigDirectives(["RequestRoot"]) … … 467 470 self.logDebug("Parsing of IPP message file %s ends." % ippmessagefile) 468 471 ippdatafile.close() 469 return ippmessage.get("job-originating-host-name")472 return (ippmessagefile, ippmessage) 470 473 471 474 def exportAttributes(self) : … … 484 487 os.environ["TEAOPTIONS"] = self.Options 485 488 os.environ["TEAINPUTFILE"] = self.InputFile or "" 489 os.environ["TEABILLING"] = self.JobBilling or "" 490 os.environ["TEACONTROLFILE"] = self.ControlFile 486 491 487 492 def saveDatasAndCheckSum(self) : -
tea4cups/trunk/tea4cups.conf
r612 r615 74 74 # TEACOPIES : Number of copies requested. 75 75 # TEAOPTIONS : Options of the print job. 76 # TEAINPUTFILE : Print job's data file or empty when job read from stdin. 76 # TEAINPUTFILE : Job's data file or empty when job read from stdin. 77 # TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps) 78 # TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????) 77 79 # 78 80 # Your own commands will mostly be interested in TEADATAFILE which is 79 81 # the name of the file from which your commands may extract the final 80 # job's datas. 82 # job's datas. Don't rely on TEAINPUTFILE, use TEADATAFILE instead 83 # since the first one may be empty depending on your printer driver. 81 84 82 85 # Now defines some default tees which will always be launched