lsst.pex.config gba4ed39666+1ac82b564f
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
lsst.pex.config.callStack.StackFrame Class Reference

Public Member Functions

 __init__ (self, filename, lineno, function, content=None)
 
 content (self)
 
 fromFrame (cls, frame)
 
 __repr__ (self)
 
 format (self, full=False)
 

Public Attributes

 filename
 
 lineno
 
 function
 

Protected Attributes

 _content
 

Static Protected Attributes

str _STRIP = "/python/lsst/"
 

Detailed Description

A single element of the stack trace.

This differs slightly from the standard system mechanisms for getting a
stack trace by the fact that it does not look up the source code until it
is absolutely necessary, reducing the I/O.

Parameters
----------
filename : `str`
    Name of file containing the code being executed.
lineno : `int`
    Line number of file being executed.
function : `str`
    Function name being executed.
content : `str`, optional
    The actual content being executed. If not provided, it will be loaded
    from the file.

Notes
-----
This differs slightly from the standard system mechanisms for getting a
stack trace by the fact that it does not look up the source code until it
is absolutely necessary, reducing the I/O.

See Also
--------
getStackFrame

Member Function Documentation

◆ content()

lsst.pex.config.callStack.StackFrame.content ( self)
Content being executed (loaded on demand) (`str`).

◆ format()

lsst.pex.config.callStack.StackFrame.format ( self,
full = False )
Format for printing.

Parameters
----------
full : `bool`, optional
    If `True`, output includes the conentent (`StackFrame.content`)
    being executed. Default is `False`.

Returns
-------
result : `str`
    Formatted string.

◆ fromFrame()

lsst.pex.config.callStack.StackFrame.fromFrame ( cls,
frame )
Construct from a Frame object.

Parameters
----------
frame : `types.FrameType`
    Frame object to interpret, such as from `inspect.currentframe`.

Returns
-------
stackFrame : `StackFrame`
    A `StackFrame` instance.

Examples
--------
`inspect.currentframe` provides a Frame object. This is a convenience
constructor to interpret that Frame object:

>>> import inspect
>>> stackFrame = StackFrame.fromFrame(inspect.currentframe())

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