Compare commits
2 Commits
5f44063755
...
4bb11a026e
| Author | SHA1 | Date |
|---|---|---|
|
|
4bb11a026e | |
|
|
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))
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
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