Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
PlonePAS.tests.test_caching.IntrospectorMethodWrapper Class Reference
Inheritance diagram for PlonePAS.tests.test_caching.IntrospectorMethodWrapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def genWrapper
def introspect
def __del__

Public Attributes

 klass
 name
 origname

Static Public Attributes

int count = 0

Private Member Functions

def _getOriginalMethod

Detailed Description

Definition at line 12 of file test_caching.py.


Constructor & Destructor Documentation

Reimplemented in PlonePAS.tests.test_caching.CollectResultsWrapper.

Definition at line 15 of file test_caching.py.

00015 
00016     def __init__(self, klass, name):
00017         self.klass = klass
00018         self.name = name
00019         self.origname = "__introspected_%s__" % name
00020         method = self.genWrapper()
00021         old_method = getattr(klass, name)
00022         setattr(klass, self.origname, old_method)
00023         setattr(klass, name, method)

Definition at line 37 of file test_caching.py.

00037 
00038     def __del__(self):
00039         setattr(self.klass, self.name, self.klass.__counted_method__)
00040         del self.klass.__counted_method__


Member Function Documentation

Definition at line 24 of file test_caching.py.

00024 
00025     def _getOriginalMethod(self, instance):
00026         return getattr(instance, self.origname)

Definition at line 27 of file test_caching.py.

00027 
00028     def genWrapper(self):
00029         introspector = self
00030         def wrapper(self, *args, **kw):
00031             result = introspector._getOriginalMethod(self)(*args, **kw)
00032             return introspector.introspect(self, args, kw, result)
00033         return wrapper

def PlonePAS.tests.test_caching.IntrospectorMethodWrapper.introspect (   self,
  instance,
  args,
  kw,
  result 
)

Reimplemented in PlonePAS.tests.test_caching.CollectResultsWrapper.

Definition at line 34 of file test_caching.py.

00034 
00035     def introspect(self, instance, args, kw, result):
00036         return result


Member Data Documentation

Definition at line 13 of file test_caching.py.

Definition at line 16 of file test_caching.py.

Definition at line 17 of file test_caching.py.

Definition at line 18 of file test_caching.py.


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