Changeset 2060 for pykota/trunk/bin/lprngpykota
- Timestamp:
- 02/14/05 23:53:44 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/lprngpykota
r2057 r2060 24 24 # 25 25 # $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 # 26 30 # Revision 1.14 2005/02/13 22:48:37 jalet 27 31 # Added the md5sum to the history … … 137 141 os.environ["PYKOTAPHASE"] = "BEFORE" 138 142 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) 145 145 os.environ["PYKOTAPRECOMPUTEDJOBPRICE"] = str(self.softwareJobPrice) 146 self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 146 147 147 148 # if no data to pass to real backend, probably a filter … … 251 252 # retrieve the job size 252 253 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") 253 256 254 257 self.printMoreInfo(user, printer, _("Job size : %i") % jobsize)