Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
plone.memoize.ram.MemcacheAdapter Class Reference
Inheritance diagram for plone.memoize.ram.MemcacheAdapter:
Inheritance graph
[legend]
Collaboration diagram for plone.memoize.ram.MemcacheAdapter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __getitem__
def __setitem__
def get

Public Attributes

 client
 globalkey

Private Member Functions

def _make_key

Detailed Description

Definition at line 121 of file ram.py.


Constructor & Destructor Documentation

def plone.memoize.ram.MemcacheAdapter.__init__ (   self,
  client,
  globalkey = '' 
)

Definition at line 122 of file ram.py.

00122 
00123     def __init__(self, client, globalkey=''):
00124         self.client = client
00125         self.globalkey = globalkey and '%s:' % globalkey

Here is the caller graph for this function:


Member Function Documentation

Definition at line 129 of file ram.py.

00129 
00130     def __getitem__(self, key):
00131         cached_value = self.client.get(self.globalkey + self._make_key(key))
00132         if cached_value is None:
00133             raise KeyError(key)
00134         else:
00135             return cPickle.loads(cached_value)

Here is the call graph for this function:

Here is the caller graph for this function:

def plone.memoize.ram.MemcacheAdapter.__setitem__ (   self,
  key,
  value 
)

Definition at line 136 of file ram.py.

00136 
00137     def __setitem__(self, key, value):
00138         cached_value = cPickle.dumps(value)
00139         self.client.set(self.globalkey + self._make_key(key), cached_value)

Here is the call graph for this function:

Here is the caller graph for this function:

def plone.memoize.ram.MemcacheAdapter._make_key (   self,
  source 
) [private]

Definition at line 126 of file ram.py.

00126 
00127     def _make_key(self, source):
00128         return md5.new(source).hexdigest()

Here is the caller graph for this function:

def plone.memoize.ram.AbstractDict.get (   self,
  key,
  default = None 
) [inherited]

Definition at line 115 of file ram.py.

00115 
00116     def get(self, key, default=None):
00117         try:
00118             return self.__getitem__(key)
00119         except KeyError:
00120             return default


Member Data Documentation

Definition at line 123 of file ram.py.

Definition at line 124 of file ram.py.


The documentation for this class was generated from the following file: