fix bugs
This commit is contained in:
parent
5f44063755
commit
91f490ff45
18
pyTSLPy.py
18
pyTSLPy.py
|
|
@ -19,9 +19,9 @@ def connectOptions(alias):
|
|||
f = connectConfigFile
|
||||
else:
|
||||
f = 'tslclient.ini'
|
||||
config = configparser.ConfigParser()
|
||||
config = configparser.ConfigParser(delimiters=('=',))
|
||||
config.read(f)
|
||||
if alias in config:
|
||||
if alias in config.sections():
|
||||
return config[alias]
|
||||
return {}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ def GetComputeBitsOption():
|
|||
def GetService():
|
||||
global defaultConnection
|
||||
if defaultConnection:
|
||||
defaultConnection.default_service()
|
||||
return defaultConnection.default_service()
|
||||
|
||||
|
||||
def parse_params(params):
|
||||
|
|
@ -100,7 +100,7 @@ def parse_params(params):
|
|||
if 'Cycle' in params:
|
||||
pp['cycle'] = params['Cycle']
|
||||
if 'CurrentDate' in params:
|
||||
pp['time'] = params['CurrentDate']
|
||||
pp['time'] = pyTSL.DoubleToDatetime(params['CurrentDate'])
|
||||
if 'bRate' in params:
|
||||
pp['rate'] = params['bRate']
|
||||
if 'RateDay' in params:
|
||||
|
|
@ -131,19 +131,11 @@ def RemoteCallFunc(func, args, params):
|
|||
global defaultConnection
|
||||
if defaultConnection:
|
||||
pp = parse_params(params)
|
||||
r = defaultConnection.clas(func, *args, **pp)
|
||||
r = defaultConnection.call(func, *args, **pp)
|
||||
return r.error(), r.value()
|
||||
return -1, '连接错误'
|
||||
|
||||
|
||||
def SetSysParam():
|
||||
assert 0
|
||||
|
||||
|
||||
def GetSysParam():
|
||||
assert 0
|
||||
|
||||
|
||||
def EncodeDate(y, m, d):
|
||||
return pyTSL.DatetimeToDouble(datetime.datetime(y, m, d))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue