Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
PlacelessTranslationService.memoize.NegotiatorMemo Class Reference
Collaboration diagram for PlacelessTranslationService.memoize.NegotiatorMemo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def memoize

Static Public Attributes

string key = 'pts.memoize_second'

Detailed Description

Definition at line 38 of file memoize.py.


Member Function Documentation

Definition at line 42 of file memoize.py.

00042 
00043     def memoize(self, func):
00044         def memogetter(*args):
00045             instance = args[0]
00046             request = args[2]
00047             
00048             annotations = IAnnotations(request)
00049             cache = annotations.get(self.key, _marker)
00050             
00051             if cache is _marker:
00052                 cache = annotations[self.key] = dict()
00053             
00054             key = hash((instance.__class__.__name__, func.__name__),)
00055             value = cache.get(key, _marker)
00056             if value is _marker:
00057                 value = cache[key] = func(*args)
00058             return value
00059         return memogetter

Here is the call graph for this function:


Member Data Documentation

string PlacelessTranslationService.memoize.NegotiatorMemo.key = 'pts.memoize_second' [static]

Definition at line 40 of file memoize.py.


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