Changeset 2450
- Timestamp:
- 09/16/05 20:52:18 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storage.py
r2409 r2450 99 99 else : 100 100 self.parent.commitTransaction() 101 self.parent.flushEntry("USERS", self.Name) 101 102 self.Exists = 0 102 103 … … 130 131 else : 131 132 self.parent.commitTransaction() 133 self.parent.flushEntry("GROUPS", self.Name) 132 134 self.Exists = 0 133 135 … … 196 198 else : 197 199 self.parent.commitTransaction() 200 self.parent.flushEntry("PRINTERS", self.Name) 198 201 self.Exists = 0 199 202 … … 358 361 def setDateLimit(self, datelimit) : 359 362 """Sets the date limit for this quota.""" 360 date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, datelimit.month, datelimit.day, datelimit.hour, datelimit.minute, datelimit.second) 363 date = "%04i-%02i-%02i %02i:%02i:%02i" % (datelimit.year, \ 364 datelimit.month, \ 365 datelimit.day, \ 366 datelimit.hour, \ 367 datelimit.minute, \ 368 datelimit.second) 361 369 self.parent.writeGroupPQuotaDateLimit(self, date) 362 370 self.DateLimit = date … … 421 429 """Deletes the billing code from the database.""" 422 430 self.parent.deleteBillingCode(self) 431 self.parent.flushEntry("BILLINGCODES", self.BillingCode) 423 432 self.Exists = 0 424 433 … … 456 465 if self.usecache : 457 466 self.tool.logdebug("Caching enabled.") 458 self.caches = { "USERS" : {}, "GROUPS" : {}, "PRINTERS" : {}, "USERPQUOTAS" : {}, "GROUPPQUOTAS" : {}, "JOBS" : {}, "LASTJOBS" : {}, "BILLINGCODES" : {} } 467 self.caches = { "USERS" : {}, \ 468 "GROUPS" : {}, \ 469 "PRINTERS" : {}, \ 470 "USERPQUOTAS" : {}, \ 471 "GROUPPQUOTAS" : {}, \ 472 "JOBS" : {}, \ 473 "LASTJOBS" : {}, \ 474 "BILLINGCODES" : {} } 459 475 460 476 def close(self) : … … 481 497 self.caches[cachetype][key] = value 482 498 self.tool.logdebug("Cache store (%s->%s)" % (cachetype, key)) 499 500 def flushEntry(self, cachetype, key) : 501 """Removes an entry from the cache.""" 502 if self.usecache : 503 try : 504 del self.caches[cachetype][key] 505 except KeyError : 506 pass 507 else : 508 self.tool.logdebug("Cache flush (%s->%s)" % (cachetype, key)) 483 509 484 510 def getUser(self, username) : -
pykota/trunk/TODO
r2446 r2450 38 38 - Make the SNMP and PJL delay and number of loops a new configuration 39 39 directive. 40 41 - Ensure that deleted or modified entries are flushed from the cache.42 40 43 41 - Adds configurability to what happens when the user/group doesn't exist