Changeset 615 for tea4cups/trunk/tea4cups
- Timestamp:
- 03/31/05 00:05:34 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
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) :