Show
Ignore:
Timestamp:
05/25/04 00:45:49 (20 years ago)
Author:
jalet
Message:

New 'enforcement' directive added
Polling loop improvements

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounter.py

    r1483 r1495  
    2222# 
    2323# $Log$ 
     24# Revision 1.15  2004/05/24 22:45:49  jalet 
     25# New 'enforcement' directive added 
     26# Polling loop improvements 
     27# 
    2428# Revision 1.14  2004/05/18 14:49:19  jalet 
    2529# Big code changes to completely remove the need for "requester" directives, 
     
    8488        self.filter = kotafilter 
    8589        self.arguments = arguments 
    86         self.isDelayed = 0      # Accounting is immediate by default 
    8790        self.firstPassSize = None 
    8891         
     
    138141            return 0 
    139142         
    140     def doAccounting(self, userpquota) : 
    141         """Does accounting for current job.""" 
    142         self.beginJob(userpquota) 
    143              
    144         # Is the current user allowed to print at all ? 
    145         action = self.filter.warnUserPQuota(userpquota) 
    146          
    147         # update the quota for the current user on this printer, if allowed to print 
    148         if action == "DENY" : 
    149             jobsize = 0 
    150         else :     
    151             # get the job size 
    152             jobsize = self.getJobSize() 
    153             userpquota.increasePagesUsage(jobsize) 
    154          
    155         # adds the current job to history     
    156         jobprice = userpquota.computeJobPrice(jobsize) 
    157         userpquota.Printer.addJobToHistory(self.filter.jobid, userpquota.User, self.getLastPageCounter(), action, jobsize, jobprice, self.filter.preserveinputfile, self.filter.title, self.filter.copies, self.filter.options) 
    158         self.endJob(userpquota) 
    159         return action 
    160          
    161143    def computeJobSize(self) :     
    162144        """Must be overriden in children classes.""" 
    163145        raise RuntimeError, "AccounterBase.computeJobSize() must be overriden !" 
    164          
    165146         
    166147def openAccounter(kotafilter) :