Package CHEM :: Package search :: Module SEARCH :: Class LimitShelfCache
[hide private]
[frames] | no frames]

Class LimitShelfCache



object --+        
         |        
      dict --+    
             |    
  Lockable --+    
             |    
    LimitCache --+
                 |
                LimitShelfCache


Works the same as a LimitCache with two very important differences:

1) data is stored in an out of memory database using the shelve module.

2) all keys are converted to strings using the str() function. MAKE
   SURE this conversion preserves the integrity of the hash. The str() function
   MUST be completely cannononical for this db to work correctly.



Instance Methods [hide private]
 
__init__(self, N=10, file='/tmp/temp.db')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__getitem__(self, key, lock=True)
x[y]
 
_setitem(self, key, value)
 
_resize(self, N)

Inherited from LimitCache: __setitem__, resize

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Inherited from Lockable: acquire, release

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, N=10, file='/tmp/temp.db')
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Returns:
new empty dictionary

Overrides: LimitCache.__init__

__getitem__(self, key, lock=True)
(Indexing operator)

 
x[y]
Overrides: LimitCache.__getitem__

_setitem(self, key, value)

 
Overrides: LimitCache._setitem

_resize(self, N)

 
Overrides: LimitCache._resize