Ejemplo n.º 1
0
	def run(self,debug=False):
		global w_builders
		g_builder=None
		wid=self.window.id()
		if wid in w_builders:
			g_builder=w_builders[wid]
		if (g_builder is not None) and (g_builder.is_running()):
			tview=self.window.active_view()
			n_console_view.add_line(tview,"Builder already running\n")
			return
		aview=self.window.active_view()
		apath=aview.file_name()
		if apath.find("_test.go")==len(apath)-8:
			self.window.run_command("gss_test")
			return
		g_builder=GoBuilder()
		g_builder.initEnv(False,"",self.window.active_view(),n_console_view)
		w_builders[wid]=g_builder
		g_builder.run()
Ejemplo n.º 2
0
			def cb(i, win):
				if i >= 0:
					a = args.get(ents[i], [])
					sargs=""
					if len(a)>0:
						sargs=a[0]
					# print sargs
					if debug:
						win.run_command('gdb_launch', {'test':True,'trun':sargs})
					else:
						global g_builder
						g_builder=GoBuilder()
						g_builder.initEnv(True,sargs,self.window.active_view(),n_console_view)
						g_builder.rcwd=pkg_dir
						g_builder.run()
Ejemplo n.º 3
0
	def on_post_save(self,view):
		if self.loading and self.loading:
			return
		self.loading=True
		apath=view.file_name()
		if apath.find(".go")!=len(apath)-3:
			return
		apath=view.file_name()
		itest=apath.find("_test.go")==len(apath)-8
		wid=view.window().id()
		g_builder=GoBuilder()
		o_b=None
		if wid in w_builders:
			o_b=w_builders[wid]
		if o_b is not None and o_b.is_running():
			g_builder.initEnv(itest,"",view,None)
		else:
			g_builder.initEnv(itest,"",view,n_console_view)
		# g_builder.showLView()
		g_builder.build(False)
		self.loading=False