Show
Ignore:
Timestamp:
02/14/05 23:53:44 (19 years ago)
Author:
jalet
Message:

Now always precomputes the job's size with the internal PDL parser, and not
only when 'enforcement: strict' was set in pykota.conf

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/lprngpykota

    r2057 r2060  
    2424# 
    2525# $Log$ 
     26# Revision 1.15  2005/02/14 22:53:44  jalet 
     27# Now always precomputes the job's size with the internal PDL parser, and not 
     28# only when 'enforcement: strict' was set in pykota.conf 
     29# 
    2630# Revision 1.14  2005/02/13 22:48:37  jalet 
    2731# Added the md5sum to the history 
     
    137141        os.environ["PYKOTAPHASE"] = "BEFORE" 
    138142         
    139         # do we want strict or laxist quota enforcement ? 
    140         if self.config.getPrinterEnforcement(printer.Name) == "STRICT" : 
    141             self.softwareJobSize = self.precomputeJobSize() 
    142             self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 
    143             self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 
    144         os.environ["PYKOTAPRECOMPUTEDJOBSIZE"] = str(self.softwareJobSize) 
     143        # precomputes the job's price 
     144        self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 
    145145        os.environ["PYKOTAPRECOMPUTEDJOBPRICE"] = str(self.softwareJobPrice) 
     146        self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 
    146147         
    147148        # if no data to pass to real backend, probably a filter 
     
    251252            # retrieve the job size     
    252253            jobsize = self.accounter.getJobSize(printer) 
     254            if self.softwareJobSize and (jobsize != self.softwareJobSize) : 
     255                self.printInfo(_("Beware : computed job size (%s) != precomputed job size (%s)") % (jobsize, self.softwareJobSize), "error") 
    253256             
    254257            self.printMoreInfo(user, printer, _("Job size : %i") % jobsize)