Changeset 1495 for pykota/trunk/pykota/accounter.py
- Timestamp:
- 05/25/04 00:45:49 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounter.py
r1483 r1495 22 22 # 23 23 # $Log$ 24 # Revision 1.15 2004/05/24 22:45:49 jalet 25 # New 'enforcement' directive added 26 # Polling loop improvements 27 # 24 28 # Revision 1.14 2004/05/18 14:49:19 jalet 25 29 # Big code changes to completely remove the need for "requester" directives, … … 84 88 self.filter = kotafilter 85 89 self.arguments = arguments 86 self.isDelayed = 0 # Accounting is immediate by default87 90 self.firstPassSize = None 88 91 … … 138 141 return 0 139 142 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 print148 if action == "DENY" :149 jobsize = 0150 else :151 # get the job size152 jobsize = self.getJobSize()153 userpquota.increasePagesUsage(jobsize)154 155 # adds the current job to history156 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 action160 161 143 def computeJobSize(self) : 162 144 """Must be overriden in children classes.""" 163 145 raise RuntimeError, "AccounterBase.computeJobSize() must be overriden !" 164 165 146 166 147 def openAccounter(kotafilter) :