本文整理汇总了Python中engine.Engine.step_into方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.step_into方法的具体用法?Python Engine.step_into怎么用?Python Engine.step_into使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类engine.Engine
的用法示例。
在下文中一共展示了Engine.step_into方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import step_into [as 别名]
class Handler:
def __init__(self, builder):
self.queue = Queue.Queue()
self.debugger = Engine(self.queue)
self.debugger.start()
self.builder = builder
self.codeview = self.setup_codeview()
self.watchesview = self.setup_watchesview()
self.open_file = None
glib.timeout_add(200, self.handle_queue)
def delete_window(self, *args):
print "Waiting for socket to close..."
self.debugger.signal = 'kill'
Gtk.main_quit(*args)
def handle_queue(self):
time.sleep(0.1) #doesn't work without it
try:
msg = self.queue.get_nowait()
except Queue.Empty:
msg = ''
if (msg):
if 'console' in msg:
self.update_console(msg['console'])
if 'stack' in msg:
self.update_stack(msg['stack'])
if 'code' in msg:
self.update_codeview(msg['code'])
if 'watchview' in msg:
self.update_watchesview(msg['watchview'])
self.update_buttons()
self.set_status('Status: ' + str(self.debugger.status))
return True
def update_buttons(self):
listen_button = self.builder.get_object("button_listen")
status = self.debugger.status
if (status == 'idle'):
listen_button.set_sensitive(True)
listen_button.set_label('Listen')
elif (status == 'listening'):
listen_button.set_sensitive(False)
listen_button.set_label('Listening...')
elif (status == 'running'):
listen_button.set_sensitive(True)
listen_button.set_label('Stop')
# BUTTONS ACTIONS
def run(self, button):
self.debugger.xrun()
def step_over(self, button):
self.debugger.step_over()
def step_into(self, button):
self.debugger.step_into()
def listen(self, button):
status = self.debugger.status
if (status == 'idle'):
self.debugger.signal = "listen"
elif (status == 'listening'):
self.debugger.signal = "stop=listening"
elif (status == 'running'):
self.debugger.signal = "stop"
# CONSOLE & STATUS
def update_console(self, text):
self.builder.get_object("console").get_buffer().set_text(text)
def update_stack(self, text):
s = text.replace('\x00', '')
stack_iter = list(ElementTree.XML(s).iter())
stack_str = ''
for e in stack_iter:
temp = e.get('filename')
if temp:
stack_str += temp + '\n'
self.builder.get_object("stack").get_buffer().set_text(stack_str)
def set_status(self, text):
context_id = Gtk.Statusbar().get_context_id("Connection");
self.builder.get_object("statusbar_main").push(context_id, text)
def execute_command(self, widget, event):
if (event.keyval == 65293):
r = self.debugger.execute(widget.get_text())
self.update_console(r)
#.........这里部分代码省略.........