Show
Ignore:
Timestamp:
03/31/05 00:05:34 (19 years ago)
Author:
jerome
Message:

job-billing is now available as $TEABILLING
Job's IPP message file is now available as $TEACONTROLFILE

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tea4cups/trunk/tea4cups

    r614 r615  
    3737from struct import unpack 
    3838 
    39 version = "2.01alpha1_unofficial" 
     39version = "2.10_unofficial" 
    4040 
    4141class TeeError(Exception): 
     
    415415        self.Directory = self.getPrintQueueOption(self.PrinterName, "directory") 
    416416        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") 
    418421             
    419422    def getCupsConfigDirectives(self, directives=[]) : 
     
    444447        return dirvalues        
    445448             
    446     def extractJobOriginatingHostName(self) :         
     449    def parseIPPMessageFile(self) :         
    447450        """Extracts the client's hostname or IP address from the CUPS message file for current job.""" 
    448451        cupsdconf = self.getCupsConfigDirectives(["RequestRoot"]) 
     
    467470                self.logDebug("Parsing of IPP message file %s ends." % ippmessagefile) 
    468471            ippdatafile.close() 
    469         return ippmessage.get("job-originating-host-name")     
     472        return (ippmessagefile, ippmessage) 
    470473                 
    471474    def exportAttributes(self) :     
     
    484487        os.environ["TEAOPTIONS"] = self.Options 
    485488        os.environ["TEAINPUTFILE"] = self.InputFile or "" 
     489        os.environ["TEABILLING"] = self.JobBilling or "" 
     490        os.environ["TEACONTROLFILE"] = self.ControlFile 
    486491         
    487492    def saveDatasAndCheckSum(self) :