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):