LSSTApplications  17.0+124,17.0+14,17.0+73,18.0.0+37,18.0.0+80,18.0.0-4-g68ffd23+4,18.1.0-1-g0001055+12,18.1.0-1-g03d53ef+5,18.1.0-1-g1349e88+55,18.1.0-1-g2505f39+44,18.1.0-1-g5315e5e+4,18.1.0-1-g5e4b7ea+14,18.1.0-1-g7e8fceb+4,18.1.0-1-g85f8cd4+48,18.1.0-1-g8ff0b9f+4,18.1.0-1-ga2c679d+1,18.1.0-1-gd55f500+35,18.1.0-10-gb58edde+2,18.1.0-11-g0997b02+4,18.1.0-13-gfe4edf0b+12,18.1.0-14-g259bd21+21,18.1.0-19-gdb69f3f+2,18.1.0-2-g5f9922c+24,18.1.0-2-gd3b74e5+11,18.1.0-2-gfbf3545+32,18.1.0-26-g728bddb4+5,18.1.0-27-g6ff7ca9+2,18.1.0-3-g52aa583+25,18.1.0-3-g8ea57af+9,18.1.0-3-gb69f684+42,18.1.0-3-gfcaddf3+6,18.1.0-32-gd8786685a,18.1.0-4-gf3f9b77+6,18.1.0-5-g1dd662b+2,18.1.0-5-g6dbcb01+41,18.1.0-6-gae77429+3,18.1.0-7-g9d75d83+9,18.1.0-7-gae09a6d+30,18.1.0-9-gc381ef5+4,w.2019.45
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 
def getCallerFrame(relative=0)
Definition: callStack.py:34

◆ 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))
199 
def getCallStack(skip=0)
Definition: callStack.py:175
def getCallerFrame(relative=0)
Definition: callStack.py:34
daf::base::PropertyList * list
Definition: fits.cc:903

◆ 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 
def getStackFrame(relative=0)
Definition: callStack.py:58
def getCallerFrame(relative=0)
Definition: callStack.py:34