예제 #1
0
def hello():
	def cb():
		global hello_sarting
		if hello_sarting:
			return
		hello_sarting = True
		print 'starting gocode'
		call_cmd(['gocode'])
		margo_cmd = list(gs.setting('margo_cmd', []))
		if not margo_cmd:
			err = 'Missing `margo_cmd`'
			gs.notice("MarGo", err)
			hello_sarting = False
			return

		margo_cmd.extend([
			"-d",
			"-call", "replace",
			"-addr", gs.setting('margo_addr', '')
		])
		print 'starting margo'
		out, err, _ = gs.runcmd(margo_cmd)
		out = out.strip()
		err = err.strip()
		if err:
			gs.notice(DOMAIN, err)
		elif out:
			gs.notice(DOMAIN, 'MarGo started %s' % out)
		hello_sarting = False

	_, err = margo.post('/', 'hello', {}, True)
	if err:
		dispatch(cb, 'Starting MarGo and gocode...')
	else:
		call_cmd(['gocode'])
예제 #2
0
def hello():
    _, err = margo.post('/', 'hello', {}, True, False)
    if err:
        dispatch(do_hello, 'Starting MarGo and gocode...')
예제 #3
0
def hello():
	_, err = margo.post('/', 'hello', {}, True, False)
	if err:
		dispatch(do_hello, 'Starting MarGo and gocode...')
예제 #4
0
def hello():
	_, err = margo.post('/', 'hello', {}, True, False)
	if err:
		dispatch(do_hello, 'Starting MarGo and gocode...')
	else:
		call_cmd([mg9.GOCODE_BIN])