LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Classes | Functions
pex.config.callStack Namespace Reference

Classes

class  StackFrame
 

Functions

def getCallerFrame (relative=0)
 
def getStackFrame (relative=0)
 
def getCallStack (skip=0)
 

Function Documentation

◆ getCallerFrame()

def pex.config.callStack.getCallerFrame (   relative = 0)
Get the frame for the user's caller.

Parameters
----------
relative : `int`, optional
    Number of frames (0 or more) above the caller to retrieve.
    Default is 0.

Returns
-------
frame : `__builtin__.Frame`
    Frame for the caller.

Notes
-----
This function is excluded from the frame.

Definition at line 34 of file callStack.py.

34 def getCallerFrame(relative=0):
35  """Get the frame for the user's caller.
36 
37  Parameters
38  ----------
39  relative : `int`, optional
40  Number of frames (0 or more) above the caller to retrieve.
41  Default is 0.
42 
43  Returns
44  -------
45  frame : `__builtin__.Frame`
46  Frame for the caller.
47 
48  Notes
49  -----
50  This function is excluded from the frame.
51  """
52  frame = inspect.currentframe().f_back.f_back # Our caller's caller
53  for ii in range(relative):
54  frame = frame.f_back
55  return frame
56 
57 

◆ getCallStack()

def pex.config.callStack.getCallStack (   skip = 0)
Retrieve the call stack for the caller.

Parameters
----------
skip : `int`, non-negative
    Number of stack frames above caller to skip.

Returns
-------
output : `list` of `StackFrame`
    The call stack. The `list` is ordered with the most recent frame to
    last.

Notes
-----
This function is excluded from the call stack.

Definition at line 175 of file callStack.py.

175 def getCallStack(skip=0):
176  """Retrieve the call stack for the caller.
177 
178  Parameters
179  ----------
180  skip : `int`, non-negative
181  Number of stack frames above caller to skip.
182 
183  Returns
184  -------
185  output : `list` of `StackFrame`
186  The call stack. The `list` is ordered with the most recent frame to
187  last.
188 
189  Notes
190  -----
191  This function is excluded from the call stack.
192  """
193  frame = getCallerFrame(skip + 1)
194  stack = []
195  while frame:
196  stack.append(StackFrame.fromFrame(frame))
197  frame = frame.f_back
198  return list(reversed(stack))

◆ getStackFrame()

def pex.config.callStack.getStackFrame (   relative = 0)
Get the `StackFrame` for the user's caller.

Parameters
----------
relative : `int`, optional
    Number of frames (0 or more) above the caller to retrieve.

Returns
-------
frame : `StackFrame`
    Stack frame for the caller.

Definition at line 58 of file callStack.py.

58 def getStackFrame(relative=0):
59  """Get the `StackFrame` for the user's caller.
60 
61  Parameters
62  ----------
63  relative : `int`, optional
64  Number of frames (0 or more) above the caller to retrieve.
65 
66  Returns
67  -------
68  frame : `StackFrame`
69  Stack frame for the caller.
70  """
71  frame = getCallerFrame(relative + 1)
72  return StackFrame.fromFrame(frame)
73 
74 
pex.config.callStack.getStackFrame
def getStackFrame(relative=0)
Definition: callStack.py:58
pex.config.callStack.getCallStack
def getCallStack(skip=0)
Definition: callStack.py:175
pex.config.callStack.getCallerFrame
def getCallerFrame(relative=0)
Definition: callStack.py:34
list
daf::base::PropertyList * list
Definition: fits.cc:913