Module disco :: Class CacheDictionary
[hide private]
[frames] | no frames]

Class CacheDictionary

source code

A dictionary that keeps items around for only a specific time. Lifetime is in minutes. Getrefresh specifies whether to refresh when an item is merely accessed instead of set aswell
Nested Classes [hide private]
  CacheItem
An object to store cache items and their timeouts
Instance Methods [hide private]
 
__init__(self, lifetime, getrefresh=True) source code
 
cleanup(self) source code
 
_expire_timeout(self, key)
The timeout has expired, remove the object
source code
 
_refresh_timeout(self, key)
The object was accessed, refresh the timeout
source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__delitem__(self, key) source code
 
__contains__(self, key) source code
 
has_key(self, key) source code
Method Details [hide private]

__init__(self, lifetime, getrefresh=True)
(Constructor)

source code 

cleanup(self)

source code 

_expire_timeout(self, key)

source code 
The timeout has expired, remove the object

_refresh_timeout(self, key)

source code 
The object was accessed, refresh the timeout

__getitem__(self, key)
(Indexing operator)

source code 

__setitem__(self, key, value)
(Index assignment operator)

source code 

__delitem__(self, key)
(Index deletion operator)

source code 

__contains__(self, key)
(In operator)

source code 

has_key(self, key)

source code