From 7b5e7c6ab067d359650546e263fda25807217567 Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Fri, 2 Dec 2016 23:50:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bvn.okcoin=E7=9A=84=E6=96=AD?= =?UTF-8?q?=E7=BA=BF=E9=87=8D=E8=BF=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.okcoin/vnokcoin.py | 2 +- vn.trader/okcoinGateway/okcoinGateway.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vn.okcoin/vnokcoin.py b/vn.okcoin/vnokcoin.py index 334d6f42..419c8b7e 100644 --- a/vn.okcoin/vnokcoin.py +++ b/vn.okcoin/vnokcoin.py @@ -185,7 +185,7 @@ class OkCoinApi(object): #---------------------------------------------------------------------- def close(self): """关闭接口""" - if self.thread and self.thread.isAlive: + if self.thread and self.thread.isAlive(): self.ws.close() self.thread.join() diff --git a/vn.trader/okcoinGateway/okcoinGateway.py b/vn.trader/okcoinGateway/okcoinGateway.py index e98f8b69..2a2e5a9f 100644 --- a/vn.trader/okcoinGateway/okcoinGateway.py +++ b/vn.trader/okcoinGateway/okcoinGateway.py @@ -108,7 +108,8 @@ class OkcoinGateway(VtGateway): """连接""" # 载入json文件 fileName = self.gatewayName + '_connect.json' - fileName = os.getcwd() + '/okcoinGateway/' + fileName + path = os.path.abspath(os.path.dirname(__file__)) + fileName = os.path.join(path, fileName) try: f = file(fileName) @@ -278,9 +279,9 @@ class Api(vnokcoin.OkCoinApi): # 重新连接 if self.active: - print 'start reconnect' + self.writeLog(u'等待5秒后重新连接') + sleep(5) self.reconnect() - print 'reconnected' #---------------------------------------------------------------------- def onOpen(self, ws):