Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_sys_setprofile.HookWatcher Class Reference
Inheritance diagram for test.test_sys_setprofile.HookWatcher:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def callback
def add_event
def get_events

Public Attributes

 frames
 events

Detailed Description

Definition at line 25 of file test_sys_setprofile.py.


Constructor & Destructor Documentation

Definition at line 26 of file test_sys_setprofile.py.

00026 
00027     def __init__(self):
00028         self.frames = []
00029         self.events = []

Here is the caller graph for this function:


Member Function Documentation

def test.test_sys_setprofile.HookWatcher.add_event (   self,
  event,
  frame = None 
)
Add an event to the log.

Definition at line 36 of file test_sys_setprofile.py.

00036 
00037     def add_event(self, event, frame=None):
00038         """Add an event to the log."""
00039         if frame is None:
00040             frame = sys._getframe(1)
00041 
00042         try:
00043             frameno = self.frames.index(frame)
00044         except ValueError:
00045             frameno = len(self.frames)
00046             self.frames.append(frame)
00047 
00048         self.events.append((frameno, event, ident(frame)))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_sys_setprofile.HookWatcher.callback (   self,
  frame,
  event,
  arg 
)

Reimplemented in test.test_sys_setprofile.ProfileSimulator.

Definition at line 30 of file test_sys_setprofile.py.

00030 
00031     def callback(self, frame, event, arg):
00032         if (event == "call"
00033             or event == "return"
00034             or event == "exception"):
00035             self.add_event(event, frame)

Here is the call graph for this function:

Here is the caller graph for this function:

Remove calls to add_event().

Definition at line 49 of file test_sys_setprofile.py.

00049 
00050     def get_events(self):
00051         """Remove calls to add_event()."""
00052         disallowed = [ident(self.add_event.__func__), ident(ident)]
00053         self.frames = None
00054 
00055         return [item for item in self.events if item[2] not in disallowed]
00056 

Here is the call graph for this function:


Member Data Documentation

Definition at line 28 of file test_sys_setprofile.py.

Definition at line 27 of file test_sys_setprofile.py.


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