- Timestamp:
- 03/01/04 16:06:51 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykota
r1359 r1376 24 24 # 25 25 # $Log$ 26 # Revision 1.54 2004/03/01 15:06:51 jalet 27 # Pre and Post hooks should now work in the pykota filter too. 28 # The pykota filter doesn't check the last user's quota anymore 29 # when delayed hardware accounting is used : this will be checked 30 # anyway the next time the last user will print 31 # 26 32 # Revision 1.53 2004/02/25 12:36:34 jalet 27 33 # Avoids a database query even if caching was disabled. … … 250 256 # be allowed if current user is allowed to print on this printer 251 257 if policy == "OK" : 258 # exports user information with initial values 259 self.exportUserInfo(userpquota) 260 261 # enters first phase 262 os.putenv("PYKOTAPHASE", "BEFORE") 263 252 264 self.logdebug("Does accounting for user %s on printer %s." % (user.Name, printer.Name)) 253 265 action = self.accounter.doAccounting(userpquota) 266 267 # exports some new environment variables 268 os.putenv("PYKOTAACTION", action) 269 270 # launches the pre hook 271 self.prehook(userpquota) 254 272 else : 255 273 action = "ALLOW" … … 302 320 lastjobsize = self.accounter.getJobSize() 303 321 self.logdebug("Last Job size : %i" % lastjobsize) 304 printer.LastJob.setSize(lastuserpquota, lastjobsize)322 lastjobprice = printer.LastJob.setSize(lastuserpquota, lastjobsize) 305 323 self.logdebug("Updating user %s's quota on printer %s" % (lastuserpquota.User.Name, printer.Name)) 306 324 lastuserpquota.increasePagesUsage(lastjobsize) 307 self.warnUserPQuota(lastuserpquota) 325 326 # exports user information with final values 327 self.exportUserInfo(lastuserpquota) 328 329 # enters final phase 330 os.putenv("PYKOTAPHASE", "AFTER") 331 os.putenv("PYKOTAACTION", printer.LastJob.JobAction) 332 os.putenv("PYKOTAJOBSIZE", str(lastjobsize)) 333 os.putenv("PYKOTAJOBPRICE", str(lastjobprice)) 334 335 # launches the post hook 336 self.posthook(lastuserpquota) 337 338 # Code below deactivated since this will be checked 339 # anyway the next time this user prints 340 # finally check last user's quota 341 # self.warnUserPQuota(lastuserpquota) 308 342 309 343 # then deal with current print job as usual -
pykota/trunk/NEWS
r1372 r1376 22 22 PyKota NEWS : 23 23 24 - 1.18alpha13 : 25 26 - Pre and Post hooks are now available in the pykota 27 filter as well. 28 29 - The pykota filter doesn't check last user's quota 30 anymore : this will be done anyway the next time 31 the last user will print again. 32 24 33 - 1.18alpha12 : 25 34 26 - pre and post hooks to external commands with many35 - Pre and Post hooks to external commands with many 27 36 many environment variables available are useable 28 37 from the cupspykota backend. -
pykota/trunk/pykota/storage.py
r1368 r1376 22 22 # 23 23 # $Log$ 24 # Revision 1.49 2004/03/01 15:06:51 jalet 25 # Pre and Post hooks should now work in the pykota filter too. 26 # The pykota filter doesn't check the last user's quota anymore 27 # when delayed hardware accounting is used : this will be checked 28 # anyway the next time the last user will print 29 # 24 30 # Revision 1.48 2004/02/27 13:50:12 jalet 25 31 # Hopefully the final fix for groups (users and printers) … … 474 480 self.JobSize = jobsize 475 481 self.JobPrice = jobprice 482 return jobprice 476 483 477 484 class BaseStorage : -
pykota/trunk/pykota/version.py
r1372 r1376 22 22 # 23 23 24 __version__ = "1.18alpha1 2_unofficial"24 __version__ = "1.18alpha13_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""