Package imagizer :: Module imagecache :: Class ImageCache
[hide private]
[frames] | no frames]

Class ImageCache

source code

object --+    
         |    
      dict --+
             |
            ImageCache

this class is a Borg : always returns the same values regardless to the instance of the object it is used as data storage for images ... with a limit on the number of images to keep in memory.

Instance Methods [hide private]
new empty dictionary

__init__(self, maxSize=100)
Constructor of ImageCache
source code
 
__setitem__(x, i, y)
x[i]=y
source code
 
__getitem__(x, y)
x[y]
source code
list of D's keys
keys(self)
Returns the list of keys, ordered
source code
v, remove specified key and return the corresponding value
pop(self, key)
Remove a key for the dictionary and return it's value
source code
 
rename(self, oldKey, newKey)
Change the name of a key without affecting anything else If the name is not present: do nothing.
source code

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

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

Class Variables [hide private]
  __shared_state = {'imageDict': {}, 'maxSize': 500, 'ordered': ...
  __data_initialized = True

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, maxSize=100)
(Constructor)

source code 

Constructor of ImageCache

Parameters:
  • maxSize - number of element to keep in memory
Returns:
new empty dictionary

Overrides: object.__init__

__setitem__(x, i, y)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__

__getitem__(x, y)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__

keys(self)

source code 

Returns the list of keys, ordered

Returns: list of D's keys
Overrides: dict.keys

pop(self, key)

source code 

Remove a key for the dictionary and return it's value

Returns: v, remove specified key and return the corresponding value
Overrides: dict.pop

Class Variable Details [hide private]

__shared_state

Value:
{'imageDict': {}, 'maxSize': 500, 'ordered': [], 'size': 0}