Changeset 1497 for pykota

Show
Ignore:
Timestamp:
05/25/04 07:17:52 (21 years ago)
Author:
jalet
Message:

Now precomputes the job's size only if current printer's enforcement
is "STRICT"

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1495 r1497  
    2424# 
    2525# $Log$ 
     26# Revision 1.50  2004/05/25 05:17:50  jalet 
     27# Now precomputes the job's size only if current printer's enforcement 
     28# is "STRICT" 
     29# 
    2630# Revision 1.49  2004/05/24 22:45:48  jalet 
    2731# New 'enforcement' directive added 
     
    256260             
    257261            # checks the user's quota 
    258             self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 
     262            if self.config.getPrinterEnforcement(printer.Name) == "STRICT" : 
     263                self.softwareJobSize = self.precomputeJobSize() 
     264                self.logdebug("Precomputed job's size is : %s pages" % self.softwareJobSize) 
     265                self.softwareJobPrice = userpquota.computeJobPrice(self.softwareJobSize) 
    259266            action = self.warnUserPQuota(userpquota) 
    260267             
  • pykota/trunk/NEWS

    r1495 r1497  
    2424    - 1.19alpha14 : 
    2525     
     26        - Pre-computation of the job's size is now only 
     27          done when enforcement is "STRICT", this saves 
     28          CPU for people who don't want to use this new 
     29          feature. 
     30           
    2631        - New 'enforcement' directive which accepts either 
    2732          STRICT or LAXIST. See sample configuration file 
  • pykota/trunk/pykota/tool.py

    r1495 r1497  
    2222# 
    2323# $Log$ 
     24# Revision 1.91  2004/05/25 05:17:52  jalet 
     25# Now precomputes the job's size only if current printer's enforcement 
     26# is "STRICT" 
     27# 
    2428# Revision 1.90  2004/05/24 22:45:49  jalet 
    2529# New 'enforcement' directive added 
     
    383387        self.smtpserver = self.config.getSMTPServer() 
    384388        self.maildomain = self.config.getMailDomain() 
     389        self.softwareJobSize = 0 
    385390        self.softwareJobPrice = 0.0 
    386391         
     
    802807        self.exportJobInfo() 
    803808        self.jobdatastream = self.openJobDataStream() 
    804         self.softwareJobSize = self.precomputeJobSize() 
    805         self.logdebug("Precomputed job's size is : %s pages" % self.softwareJobSize) 
    806809         
    807810    def openJobDataStream(self) :     
     
    838841        """Computes the job size with a software method.""" 
    839842        self.logdebug("Precomputing job's size with generic PDL analyzer...") 
     843        self.jobdatastream.seek(0) 
    840844        try : 
    841845            parser = pdlanalyzer.PDLAnalyzer(self.jobdatastream)