- Timestamp:
- 05/25/04 11:15:15 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r1498 r1499 24 24 # 25 25 # $Log$ 26 # Revision 1.52 2004/05/25 09:15:13 jalet 27 # accounter.py : old code deleted 28 # the rest : now exports PYKOTAPRECOMPUTEDJOBSIZE and PYKOTAPRECOMPUTEDJOBPRICE 29 # 26 30 # Revision 1.51 2004/05/25 08:31:16 jalet 27 31 # Heavy CPU usage seems to be fixed at least ! … … 265 269 if self.config.getPrinterEnforcement(printer.Name) == "STRICT" : 266 270 self.softwareJobSize = self.precomputeJobSize() 267 self.logdebug("Precomputed job's size is : %s pages" % self.softwareJobSize)268 271 self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 272 self.logdebug("Precomputed job's size is %s pages, price is %s units" % (self.softwareJobSize, self.softwareJobPrice)) 273 os.putenv("PYKOTAPRECOMPUTEDJOBSIZE", str(self.softwareJobSize)) 274 os.putenv("PYKOTAPRECOMPUTEDJOBPRICE", str(self.softwareJobPrice)) 269 275 action = self.warnUserPQuota(userpquota) 270 276 -
pykota/trunk/conf/pykota.conf.sample
r1495 r1499 453 453 # PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota 454 454 # else is not set. 455 # PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size 456 # PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price 457 # 455 458 456 459 # PreHook : gets executed after being sure the user, printer and user quota -
pykota/trunk/NEWS
r1498 r1499 24 24 - 1.19alpha14 : 25 25 26 - PYKOTAPRECOMPUTEDJOBSIZE and PYKOTAPRECOMPUTEDJOBPRICE 27 are now exported as environment variables. 28 26 29 - Heavy CPU usage is now completely fixed it seems, by 27 30 introducing some 0.01 second sleeping when nothing to do. -
pykota/trunk/pykota/accounter.py
r1495 r1499 22 22 # 23 23 # $Log$ 24 # Revision 1.16 2004/05/25 09:15:15 jalet 25 # accounter.py : old code deleted 26 # the rest : now exports PYKOTAPRECOMPUTEDJOBSIZE and PYKOTAPRECOMPUTEDJOBPRICE 27 # 24 28 # Revision 1.15 2004/05/24 22:45:49 jalet 25 29 # New 'enforcement' directive added … … 71 75 72 76 import sys 73 from pykota import pdlanalyzer74 77 75 78 class PyKotaAccounterError(Exception): … … 88 91 self.filter = kotafilter 89 92 self.arguments = arguments 90 self.firstPassSize = None91 92 def getSoftwareJobSize(self) :93 """Pre-computes the job's size with a software method."""94 if self.filter.preserveinputfile is None :95 raise PyKotaAccounterError, "Only supports raw jobs for now."""96 else :97 fname = self.filter.preserveinputfile98 parser = pdfanalyzer.PDLAnalyzer(fname)99 try :100 jobsize = parser.getJobSize()101 except TypeError, msg :102 raise PyKotaAccounterError, msg103 else :104 self.firstPassSize = jobsize105 93 106 94 def getLastPageCounter(self) :