All Samples(374) | Call(289) | Derive(0) | Import(85)
Print a stack trace from its invocation point. The optional 'f' argument can be used to specify an alternate stack frame at which to start. The optional 'limit' and 'file' arguments have the same meaning as for print_exception().
def print_stack(f=None, limit=None, file=None):
"""Print a stack trace from its invocation point.
The optional 'f' argument can be used to specify an alternate
stack frame at which to start. The optional 'limit' and 'file'
arguments have the same meaning as for print_exception().
"""
if f is None:
try:
raise ZeroDivisionError
except ZeroDivisionError:
f = sys.exc_info()[2].tb_frame.f_back
print_list(extract_stack(f, limit), file)
def dump_stack(*args):
"""
Useful for debugging your program if it's spinning into infinite loops.
Install this signal handler and issue your program a SIGQUIT to dump the
main thread's stack, so you can see where it is.
"""
from traceback import print_stack
from cStringIO import StringIO
s = StringIO()
for tid, frame in _current_frames().iteritems():
print >> s, 'thread', tid
print_stack(f = frame, file = s)
src/p/y/python-commons-0.7/src/commons/startup.py python-commons(Download)
def dump_stack(*args):
"""
Useful for debugging your program if it's spinning into infinite loops.
Install this signal handler and issue your program a SIGQUIT to dump the
main thread's stack, so you can see where it is.
"""
from traceback import print_stack
from cStringIO import StringIO
s = StringIO()
for tid, frame in _current_frames().iteritems():
print >> s, 'thread', tid
print_stack(f = frame, file = s)
src/a/p/appscript-HEAD/py-osacomponent/trunk/src/PyOSA/pyosa_errors.py appscript(Download)
import MacOS from sys import exc_info, stderr from traceback import extract_tb, print_stack from aem.kae import * from pyosa_appscript import aem, appscript
def raisecomponenterror(errornumber, errormessage=''): print >> stderr, 'raise ComponentError:' print >> stderr, '-' * 80 print_stack(None, 20, stderr) print >> stderr, '-' * 80 print >> stderr raise ComponentError(errornumber, errormessage)
src/o/r/orcatorrent-HEAD/Core/BitTornado/BT1/Encrypter.py orcatorrent(Download)
from sets import Set # 2fastbt_ from traceback import print_exc, extract_stack, print_stack import sys from Tribler.Core.Overlay.SecureOverlay import SecureOverlay from Tribler.Core.BitTornado.BT1.MessageID import protocol_name,option_pattern
src/o/r/orcatorrent-HEAD/Core/CacheDB/SqliteSeedingStatsCacheDB.py orcatorrent(Download)
import math from random import shuffle import threading from traceback import print_exc, extract_stack, print_stack from Tribler.__init__ import LIBRARYNAME from Tribler.Core.CacheDB.sqlitecachedb import *
src/o/r/orcatorrent-HEAD/Core/CacheDB/sqlitecachedb.py orcatorrent(Download)
import math from random import shuffle import threading from traceback import print_exc, extract_stack, print_stack from Tribler.__init__ import LIBRARYNAME
src/o/r/orcatorrent-HEAD/Core/CacheDB/SqliteFriendshipStatsCacheDB.py orcatorrent(Download)
import math from random import shuffle import threading from traceback import print_exc, extract_stack, print_stack from Tribler.__init__ import LIBRARYNAME from Tribler.Core.CacheDB.sqlitecachedb import *
src/o/r/orcatorrent-HEAD/Main/vwxGUI/standardOverview.py orcatorrent(Download)
# Written by Jelle Roozenburg, Maarten ten Brinke # see LICENSE.txt for license information import wx, os, sys, os.path import wx.xrc as xrc from traceback import print_exc,print_stack from Tribler.Core.simpledefs import * from Tribler.Core.Utilities.unicode import * from Tribler.Core.Utilities.utilities import sort_dictlist from Tribler.Core.Utilities.utilities import * from Tribler.Main.vwxGUI.GuiUtility import GUIUtility from traceback import print_exc,print_stack
src/o/r/orcatorrent-HEAD/Core/Overlay/SecureOverlay.py orcatorrent(Download)
from struct import pack,unpack from threading import currentThread from time import time from traceback import print_exc,print_stack import sys from Tribler.Core.BitTornado.BT1.MessageID import protocol_name,option_pattern,getMessageName
def get_dns_from_peerdb(self,permid,use_cache=True):
# Called by any thread, except NetworkThread
if currentThread().getName().startswith("NetworkThread"):
print >>sys.stderr,"secover: get_dns_from_peerdb: called by NetworkThread!"
print_stack()
def add_peer_to_db(self,permid,dns,selversion):
""" add a connected peer to database """
# Called by OverlayThread
if currentThread().getName().startswith("NetworkThread"):
print >>sys.stderr,"secover: add_peer_to_peerdb: called by NetworkThread!"
print_stack()
def update_peer_status(self,permid,authwasdone):
""" update last_seen and last_connected in peer db when close """
# Called by OverlayThread
if currentThread().getName().startswith("NetworkThread"):
print >>sys.stderr,"secover: update_peer_status: called by NetworkThread!"
print_stack()
src/k/a/kamaelia-HEAD/trunk/Sketches/RJL/bittorrent/BitTorrent/BitTorrent/NatTraversal.py kamaelia(Download)
import urlparse
import random
from traceback import print_stack, print_tb, print_exc
def UnsupportedWarning(logfunc, s):
logfunc(WARNING, "NAT Traversal warning " + ("(%s: %s)." % (os_version, s)))
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next