本文整理汇总了Python中wdb.set_trace函数的典型用法代码示例。如果您正苦于以下问题:Python set_trace函数的具体用法?Python set_trace怎么用?Python set_trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_trace函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
print('Process 2 start')
# sleep(2)
import wdb; wdb.set_trace()
sleep(1)
print('Process 2 end')
开发者ID:TFenby,项目名称:wdb,代码行数:7,代码来源:forks.py
示例2: wtf_error
def wtf_error():
import wdb
wdb.set_trace()
a = 2
a / 0
return 12
开发者ID:seletz,项目名称:wdb,代码行数:7,代码来源:wsgi.py
示例3: wtf
def wtf():
a = 12
b = 21
c = a / b
import wdb
wdb.set_trace()
d = a - 2
e = b + a - c + d
return 'OK! %d' % e
开发者ID:fdev31,项目名称:wdb,代码行数:9,代码来源:run.py
示例4: wtf
def wtf():
a = 12
b = 21
c = a / b
import wdb
wdb.set_trace()
d = a - 2
e = b + a - c + d
for i in range(5):
e += i
# Test breaking on /usr/lib/python2.7/logging/__init__.py:1254
app.logger.info('I was here')
return 'OK! %d' % e
开发者ID:JacekPliszka,项目名称:wdb,代码行数:13,代码来源:wsgi.py
示例5: read_from_bottom_
def read_from_bottom_(n, filename):
def index_of_next_line(string):
return string.find("\n")
with open(filename, "r") as f:
file_as_string = f.read()
wdb.set_trace()
runnerIndex = index_of_next_line(file_as_string) + 1
for i in range(n-1):
print file_as_string[runnerIndex:]
runnerIndex = runnerIndex + index_of_next_line(file_as_string[runnerIndex:])
开发者ID:rmawong,项目名称:Coding-Problems,代码行数:13,代码来源:read_nth_last_lines.py
示例6: f
def f():
# Enable wdb
wdb = Wdb.get()
Wdb.enabled = True
start_response('200 OK', [
('Content-Type', 'text/html'), ('X-Thing', wdb.uuid)])
yield to_bytes(' ' * 4096)
wdb = set_trace()
wdb.die()
yield to_bytes('Exited')
开发者ID:niziou,项目名称:wdb,代码行数:10,代码来源:ext.py
示例7: Execute
def Execute(self, config, context):
try:
log.LogInfo("Running TEST.Execute")
import wdb
wdb.set_trace()
print "trace"
x()
x()
x()
print "endtrace"
#cl = RepoServiceClient(context.Site)
# TODO sometime - config validation before updating, report errors and keep the working old config
#cl.Reload(context.ListItem)
return "TEST"
except Exception, exc:
log.LogError("TEST plugin failed with exception", exc)
开发者ID:NAVERTICA,项目名称:SPTools,代码行数:20,代码来源:TESTPlugin.py
示例8: __call__
def __call__(self, environ, start_response):
path = environ.get('PATH_INFO', '')
if path == '/__wdb/on':
# Enable wdb
Wdb.enabled = True
start_response('200 OK', [('Content-Type', 'text/html')])
return to_bytes('Wdb is now on'),
if path == '/__wdb/shell':
# Enable wdb
Wdb.enabled = True
wdb = set_trace()
start_response('200 OK', [('Content-Type', 'text/html')])
wdb.die()
return to_bytes('Exited'),
if Wdb.enabled:
def trace_wsgi(environ, start_response):
appiter = None
try:
with trace(close_on_exit=True):
appiter = self.app(environ, start_response)
for item in appiter:
yield item
except Exception:
start_response('500 INTERNAL SERVER ERROR', [
('Content-Type', 'text/html')])
yield _handle_off()
finally:
hasattr(appiter, 'close') and appiter.close()
return trace_wsgi(environ, start_response)
def catch(environ, start_response):
appiter = None
try:
appiter = self.app(environ, start_response)
for item in appiter:
yield item
except Exception:
start_response('500 INTERNAL SERVER ERROR', [
('Content-Type', 'text/html')])
yield _handle_off()
finally:
# Close set_trace debuggers
stop_trace(close_on_exit=True)
hasattr(appiter, 'close') and appiter.close()
return catch(environ, start_response)
开发者ID:B-Rich,项目名称:wdb,代码行数:49,代码来源:ext.py
示例9: tf
def tf(self):
set_trace(sys._getframe().f_back)
开发者ID:niziou,项目名称:wdb,代码行数:2,代码来源:ext.py
示例10: self_shell
def self_shell(variables):
# Debugging self
import wdb
wdb.set_trace()
开发者ID:hekevintran,项目名称:wdb,代码行数:4,代码来源:__init__.py
示例11: u
# -*- coding: latin-1 -*-
import sys
def u(s):
"""Python 3.2..."""
if sys.version_info[0] == 2:
return s.decode('latin-1')
return s
print(u('יאח'))
import wdb
wdb.set_trace()
开发者ID:JacekPliszka,项目名称:wdb,代码行数:14,代码来源:latin-1.py
示例12: run
def run(self):
print('Thread 2 start')
sleep(2)
import wdb; wdb.set_trace()
print('Thread 2 end')
开发者ID:seletz,项目名称:wdb,代码行数:5,代码来源:threads.py
示例13: fun2
def fun2(l):
import wdb; wdb.set_trace()
a = 2
e = fun1(a)
return e
开发者ID:Avinash9,项目名称:wdb,代码行数:5,代码来源:trace_in_script.py
示例14: trigger_wdb
def trigger_wdb(self, msg, matches):
peer = self.bot.get_peer_to_send(msg)
wdb.set_trace()
开发者ID:maikelwever,项目名称:telex-wdb,代码行数:3,代码来源:wdb.py
示例15:
import os
print 'Forking'
pid = os.fork()
if pid == 0:
print 'In children'
import wdb; wdb.set_trace()
print 'Children dead'
else:
print 'In parent'
import wdb; wdb.set_trace()
print 'Parent dead'
print 'The End'
开发者ID:seletz,项目名称:wdb,代码行数:16,代码来源:osfork.py
示例16: post_test
def post_test():
a = 2
import wdb
wdb.set_trace()
return "POST RETURN %r" % request.values
开发者ID:seletz,项目名称:wdb,代码行数:6,代码来源:wsgi.py
注:本文中的wdb.set_trace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论