Compare commits
No commits in common. "4bb11a026eb98c17e37a3aa2648089b687b27282" and "5f44063755ff29dcf7752318722a3fdbf4b03eee" have entirely different histories.
4bb11a026e
...
5f44063755
18
pyTSLPy.py
18
pyTSLPy.py
|
|
@ -19,9 +19,9 @@ def connectOptions(alias):
|
||||||
f = connectConfigFile
|
f = connectConfigFile
|
||||||
else:
|
else:
|
||||||
f = 'tslclient.ini'
|
f = 'tslclient.ini'
|
||||||
config = configparser.ConfigParser(delimiters=('=',))
|
config = configparser.ConfigParser()
|
||||||
config.read(f)
|
config.read(f)
|
||||||
if alias in config.sections():
|
if alias in config:
|
||||||
return config[alias]
|
return config[alias]
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ def GetComputeBitsOption():
|
||||||
def GetService():
|
def GetService():
|
||||||
global defaultConnection
|
global defaultConnection
|
||||||
if defaultConnection:
|
if defaultConnection:
|
||||||
return defaultConnection.default_service()
|
defaultConnection.default_service()
|
||||||
|
|
||||||
|
|
||||||
def parse_params(params):
|
def parse_params(params):
|
||||||
|
|
@ -100,7 +100,7 @@ def parse_params(params):
|
||||||
if 'Cycle' in params:
|
if 'Cycle' in params:
|
||||||
pp['cycle'] = params['Cycle']
|
pp['cycle'] = params['Cycle']
|
||||||
if 'CurrentDate' in params:
|
if 'CurrentDate' in params:
|
||||||
pp['time'] = pyTSL.DoubleToDatetime(params['CurrentDate'])
|
pp['time'] = params['CurrentDate']
|
||||||
if 'bRate' in params:
|
if 'bRate' in params:
|
||||||
pp['rate'] = params['bRate']
|
pp['rate'] = params['bRate']
|
||||||
if 'RateDay' in params:
|
if 'RateDay' in params:
|
||||||
|
|
@ -131,11 +131,19 @@ def RemoteCallFunc(func, args, params):
|
||||||
global defaultConnection
|
global defaultConnection
|
||||||
if defaultConnection:
|
if defaultConnection:
|
||||||
pp = parse_params(params)
|
pp = parse_params(params)
|
||||||
r = defaultConnection.call(func, *args, **pp)
|
r = defaultConnection.clas(func, *args, **pp)
|
||||||
return r.error(), r.value()
|
return r.error(), r.value()
|
||||||
return -1, '连接错误'
|
return -1, '连接错误'
|
||||||
|
|
||||||
|
|
||||||
|
def SetSysParam():
|
||||||
|
assert 0
|
||||||
|
|
||||||
|
|
||||||
|
def GetSysParam():
|
||||||
|
assert 0
|
||||||
|
|
||||||
|
|
||||||
def EncodeDate(y, m, d):
|
def EncodeDate(y, m, d):
|
||||||
return pyTSL.DatetimeToDouble(datetime.datetime(y, m, d))
|
return pyTSL.DatetimeToDouble(datetime.datetime(y, m, d))
|
||||||
|
|
||||||
|
|
|
||||||
19
setup.py
19
setup.py
|
|
@ -1,19 +0,0 @@
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name="pyTSLPy",
|
|
||||||
version="0.2",
|
|
||||||
author="Wei guangjing",
|
|
||||||
author_email="vcc@py3k.cn",
|
|
||||||
description="用pyTSL模拟TSLPy",
|
|
||||||
url="https://py3k.cn/pyTSLPy/",
|
|
||||||
packages=['pyTSLPy'],
|
|
||||||
install_requires=['tspytsl>=1.0'],
|
|
||||||
classifiers = [
|
|
||||||
'Development Status :: 5 - Production/Stable',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'Topic :: Software Development :: Libraries',
|
|
||||||
'License :: OSI Approved :: MIT License',
|
|
||||||
'Programming Language :: Python :: 3'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
Loading…
Reference in New Issue