Compare commits
No commits in common. "master" and "master" have entirely different histories.
|
|
@ -19,9 +19,9 @@ def connectOptions(alias):
|
|||
f = connectConfigFile
|
||||
else:
|
||||
f = 'tslclient.ini'
|
||||
config = configparser.ConfigParser(delimiters=('=',))
|
||||
config = configparser.ConfigParser()
|
||||
config.read(f)
|
||||
if alias in config.sections():
|
||||
if alias in config:
|
||||
return config[alias]
|
||||
return {}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ def GetComputeBitsOption():
|
|||
def GetService():
|
||||
global defaultConnection
|
||||
if defaultConnection:
|
||||
return defaultConnection.default_service()
|
||||
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'] = pyTSL.DoubleToDatetime(params['CurrentDate'])
|
||||
pp['time'] = params['CurrentDate']
|
||||
if 'bRate' in params:
|
||||
pp['rate'] = params['bRate']
|
||||
if 'RateDay' in params:
|
||||
|
|
@ -123,7 +123,7 @@ def RemoteExecute(script, params):
|
|||
if defaultConnection:
|
||||
pp = parse_params(params)
|
||||
r = defaultConnection.exec(script, **pp)
|
||||
return r.error(), r.value(), r.message()
|
||||
return r.error(), r.value()
|
||||
return -1, '连接错误'
|
||||
|
||||
|
||||
|
|
@ -131,11 +131,19 @@ def RemoteCallFunc(func, args, params):
|
|||
global defaultConnection
|
||||
if defaultConnection:
|
||||
pp = parse_params(params)
|
||||
r = defaultConnection.call(func, *args, **pp)
|
||||
return r.error(), r.value(), r.message()
|
||||
r = defaultConnection.clas(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))
|
||||
|
||||
|
|
@ -155,12 +163,12 @@ def DecodeDate(dt):
|
|||
|
||||
def DecodeTime(dt):
|
||||
d = pyTSL.DoubleToDatetime(dt)
|
||||
return d.hour, d.minute, d.second, d.microsecond / 1000
|
||||
return d.hour, d.minute, d.second, d.microsecond * 1000
|
||||
|
||||
|
||||
def DecodeDateTime(dt):
|
||||
d = pyTSL.DoubleToDatetime(dt)
|
||||
return d.year, d.month, d.day, d.hour, d.minute, d.second, d.microsecond / 1000
|
||||
return d.year, d.month, d.day, d.hour, d.minute, d.second, d.microsecond * 1000
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
19
setup.py
19
setup.py
|
|
@ -1,19 +0,0 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name="pyTSLPy",
|
||||
version="0.3",
|
||||
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