All Samples(1081) | Call(1039) | Derive(0) | Import(42)
_getframe([depth]) -> frameobject Return a frame object from the call stack. If optional integer depth is given, return the frame object that many calls below the top of the stack. If that is deeper than the call stack, ValueError is raised. The default for depth is zero, returning the frame at the top of the call stack. This function should be used for internal and specialized purposes only.
src/c/h/changingsong-HEAD/trunk/samples/plugin_sys/pyutilib/pyutilib/component/core/core.py changingsong(Download)
If the `inherits` option is True, then this `Plugin` class
inherits from the `interface` class.
"""
frame = sys._getframe(1)
locals_ = frame.f_locals
#
# Some sanity checks
src/c/h/changingsong-HEAD/samples/plugin_sys/pyutilib/pyutilib/component/core/core.py changingsong(Download)
If the `inherits` option is True, then this `Plugin` class
inherits from the `interface` class.
"""
frame = sys._getframe(1)
locals_ = frame.f_locals
#
# Some sanity checks
src/m/a/matplotlib-HEAD/py4science/examples/iterators_example.py matplotlib(Download)
def measure(code_str,times=1):
""" Return elapsed time for executing code_str in the
namespace of the caller for given times.
"""
frame = sys._getframe(1)
locs,globs = frame.f_locals,frame.f_globals
code = compile(code_str,'<Timing code>','exec')
src/d/j/django-navbar-0.3.0/examples/dbgp/client.py django-navbar(Download)
def dispatch_interaction(self, frame, arg = None):
if os.name == 'java':
f = sys._getframe()
while f.f_back:
f = f.f_back
# if the very top item on the stack is __del__
# then we must be in a Jython finalization thread
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/inspect.py ironruby(Download)
def stack(context=1):
"""Return a list of records for the stack above the caller's frame."""
return getouterframes(sys._getframe(1), context)
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_info()[2], context)
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/inspect.py ironruby(Download)
def stack(context=1):
"""Return a list of records for the stack above the caller's frame."""
return getouterframes(sys._getframe(1), context)
def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_info()[2], context)
src/p/y/pypy3-HEAD/py/impl/code/_assertionold.py pypy3(Download)
def check(s, frame=None):
if frame is None:
import sys
frame = sys._getframe(1)
frame = py.code.Frame(frame)
expr = parse(s, 'eval')
assert isinstance(expr, ast.Expression)
def run(s, frame=None):
if frame is None:
import sys
frame = sys._getframe(1)
frame = py.code.Frame(frame)
module = Interpretable(parse(s, 'exec').node)
try:
src/p/y/pypy3-HEAD/py/impl/code/source.py pypy3(Download)
"""
if not filename or py.path.local(filename).check(file=0):
if _genframe is None:
_genframe = sys._getframe(1) # the caller
fn,lineno = _genframe.f_code.co_filename, _genframe.f_lineno
if not filename:
filename = '<codegen %s:%d>' % (fn, lineno)
if _ast is not None and isinstance(source, _ast.AST):
# XXX should Source support having AST?
return cpy_compile(source, filename, mode, flags, dont_inherit)
_genframe = sys._getframe(1) # the caller
s = Source(source)
co = s.compile(filename, mode, flags, _genframe=_genframe)
return co
src/j/y/jython-HEAD/sandbox/tobias/lib/benchmark.py jython(Download)
def run(*cases, **params):
if not cases:
if hasattr(sys, '_getframe'):
frame = sys._getframe(1)
while frame and frame.f_globals['__name__'] == __name__:
frame = frame.f_back
if frame:
src/w/i/winpdb-HEAD/trunk/winpdb/rpdb2.py winpdb(Download)
l = time.localtime(t)
s = time.strftime('%H:%M:%S', l) + '.%03d' % ((t - int(t)) * 1000)
f = sys._getframe(1)
filename = os.path.basename(f.f_code.co_filename)
lineno = f.f_lineno
def __find_eval_exec_frame_in_stack():
f = sys._getframe(0)
while f != None:
filename = f.f_code.co_filename
name = f.f_code.co_name
def __find_debugger_frame():
frame = None
f = sys._getframe(0)
while f != None:
filename = f.f_code.co_filename
def __settrace(depth = 2):
if g_debugger is None:
return
f = sys._getframe(depth)
g_debugger.settrace(f, f_break_on_init = False)
def __setbreak():
if g_debugger is None:
return
f = sys._getframe(2)
g_server_lock.acquire()
if g_debugger is not None and timeout == 0:
f = sys._getframe(2)
g_debugger.settrace(f, f_break_on_init = False)
return
if g_debugger is not None:
f = sys._getframe(2)
if (not fAllowUnencrypted) and not is_encryption_supported():
raise EncryptionNotSupported
f = sys._getframe(2)
filename = calc_frame_path(f)
#
except:
pass
f = sys._getframe(0)
g_debugger.settrace(f, f_break_on_init = False, builtins_hack = ExpandedFilename)
g_module_main = -1
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next