- 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
'''
import vtGlobal
import os
import json
from copy import copy
@ -98,9 +98,11 @@ class CtpGateway(VtGateway):
def connect(self):
"""连接"""
# 载入json文件
fileName = self.gatewayName + '_connect.json'
path = os.path.abspath(os.path.dirname(__file__))
fileName = os.path.join(path, fileName)
fileName = vtGlobal.VT_setting.get(self.gatewayName + '_connect')
if fileName is None:
fileName = self.gatewayName + '_connect.json'
path = os.path.abspath(os.path.dirname(__file__))
fileName = os.path.join(path, fileName)
try:
f = file(fileName)