- change : CTP_connect 通过 VT_setting.json 文件来指定

This commit is contained in:
lamter 2017-04-26 23:07:56 +08:00
parent 3cbf54cffa
commit d4686b6275

View File

@ -7,7 +7,7 @@ vn.ctp的gateway接入
vtSymbol直接使用symbol vtSymbol直接使用symbol
''' '''
import vtGlobal
import os import os
import json import json
from copy import copy from copy import copy
@ -98,6 +98,8 @@ class CtpGateway(VtGateway):
def connect(self): def connect(self):
"""连接""" """连接"""
# 载入json文件 # 载入json文件
fileName = vtGlobal.VT_setting.get(self.gatewayName + '_connect')
if fileName is None:
fileName = self.gatewayName + '_connect.json' fileName = self.gatewayName + '_connect.json'
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
fileName = os.path.join(path, fileName) fileName = os.path.join(path, fileName)