当前位置: 首页>>代码示例>>Python>>正文


Python Engine.step_over方法代码示例

本文整理汇总了Python中engine.Engine.step_over方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.step_over方法的具体用法?Python Engine.step_over怎么用?Python Engine.step_over使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在engine.Engine的用法示例。


在下文中一共展示了Engine.step_over方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import step_over [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)



#.........这里部分代码省略.........
开发者ID:artbek,项目名称:PyXdebugClient,代码行数:103,代码来源:gui_handler.py


注:本文中的engine.Engine.step_over方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。