- Timestamp:
- 02/25/04 13:36:34 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykota
r1292 r1359 24 24 # 25 25 # $Log$ 26 # Revision 1.53 2004/02/25 12:36:34 jalet 27 # Avoids a database query even if caching was disabled. 28 # 26 29 # Revision 1.52 2004/01/14 15:57:54 jalet 27 30 # Missing return caused problems with LPRng … … 299 302 lastjobsize = self.accounter.getJobSize() 300 303 self.logdebug("Last Job size : %i" % lastjobsize) 301 printer.LastJob.setSize(last jobsize)304 printer.LastJob.setSize(lastuserpquota, lastjobsize) 302 305 self.logdebug("Updating user %s's quota on printer %s" % (lastuserpquota.User.Name, printer.Name)) 303 306 lastuserpquota.increasePagesUsage(lastjobsize) -
pykota/trunk/pykota/storage.py
r1358 r1359 22 22 # 23 23 # $Log$ 24 # Revision 1.43 2004/02/25 12:36:34 jalet 25 # Avoids a database query even if caching was disabled. 26 # 24 27 # Revision 1.42 2004/02/23 22:53:21 jalet 25 28 # Don't retrieve data when it's not needed, to avoid database queries … … 428 431 def __init__(self, parent, printer) : 429 432 StorageJob.__init__(self, parent) 433 self.PrinterName = printer.Name # not needed 430 434 self.Printer = printer 431 self.UserName = None432 435 433 436 def __getattr__(self, name) : … … 439 442 raise AttributeError, name 440 443 441 def setSize(self, jobsize) :444 def setSize(self, userpquota, jobsize) : 442 445 """Sets the last job's size.""" 443 jobprice = self.parent.getUserPQuota(self.User, self.Printer).computeJobPrice(jobsize)446 jobprice = userpquota.computeJobPrice(jobsize) 444 447 self.parent.writeLastJobSize(self, jobsize, jobprice) 445 448 self.JobSize = jobsize