From be92ca0dedbc196defb382c13a0289b1b792f577 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Sat, 17 Jun 2017 20:02:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ROOT=5FPATH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtServer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vnpy/trader/vtServer.py b/vnpy/trader/vtServer.py index dace151c..1e78272f 100644 --- a/vnpy/trader/vtServer.py +++ b/vnpy/trader/vtServer.py @@ -1,7 +1,16 @@ # encoding: utf-8 -import sys import os +import sys + +import ctypes +from datetime import datetime, timedelta, date +from time import sleep +from threading import Thread + +# 将repostory的目录i,作为根目录,添加到系统环境中。 +ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..','..')) +sys.path.append(ROOT_PATH) from datetime import datetime from time import sleep @@ -33,6 +42,7 @@ class VtServer(RpcServer): # 注册主引擎的方法到服务器的RPC函数 self.register(self.engine.connect) + self.register(self.engine.disconnect) self.register(self.engine.subscribe) self.register(self.engine.sendOrder) self.register(self.engine.cancelOrder)