TSMasterAPI 2024.8.21.1168__tar.gz → 2024.8.22.1170__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/PKG-INFO +1 -1
- TSMasterAPI-2024.8.22.1170/TSMasterAPI/TSDirver.py +57 -0
- TSMasterAPI-2024.8.22.1170/TSMasterAPI/__init__.py +2 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/PKG-INFO +1 -1
- TSMasterAPI-2024.8.21.1168/TSMasterAPI/TSDirver.py +0 -56
- TSMasterAPI-2024.8.21.1168/TSMasterAPI/__init__.py +0 -2
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/README.rst +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSAPI.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSCallback.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSEnum.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSFibex_parse.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSMasterAPI.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/TSStruct.py +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/windows/bin/TSMaster.dll +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/windows/bin64/TSMaster.dll +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/SOURCES.txt +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/dependency_links.txt +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/top_level.txt +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/license.txt +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/setup.cfg +0 -0
- {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/setup.py +0 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
'''
|
2
|
+
Author: seven 865762826@qq.com
|
3
|
+
Date: 2023-04-21 11:21:33
|
4
|
+
LastEditors: seven 865762826@qq.com
|
5
|
+
LastEditTime: 2023-11-22 10:26:17
|
6
|
+
'''
|
7
|
+
from ctypes import WinDLL
|
8
|
+
import os
|
9
|
+
import winreg
|
10
|
+
import platform
|
11
|
+
dll_path = ''
|
12
|
+
try:
|
13
|
+
TSMaster_location = r"Software\TOSUN\TSMaster"
|
14
|
+
|
15
|
+
_curr_path = os.path.dirname(__file__)
|
16
|
+
|
17
|
+
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, TSMaster_location)
|
18
|
+
|
19
|
+
_arch, _os = platform.architecture()
|
20
|
+
|
21
|
+
i = 0
|
22
|
+
while True:
|
23
|
+
try:
|
24
|
+
if _arch == '32bit':
|
25
|
+
# 获取注册表对应位置的键和值
|
26
|
+
if winreg.EnumValue(key, i)[0] == 'libTSMaster_x86':
|
27
|
+
dll_path = winreg.EnumValue(key, i)[1]
|
28
|
+
winreg.CloseKey(key)
|
29
|
+
break
|
30
|
+
else:
|
31
|
+
if winreg.EnumValue(key, i)[0] == 'libTSMaster_x64':
|
32
|
+
dll_path = winreg.EnumValue(key, i)[1]
|
33
|
+
winreg.CloseKey(key)
|
34
|
+
break
|
35
|
+
i += 1
|
36
|
+
except OSError as error:
|
37
|
+
# 一定要关闭这个键
|
38
|
+
winreg.CloseKey(key)
|
39
|
+
break
|
40
|
+
except:
|
41
|
+
pass
|
42
|
+
if dll_path != '':
|
43
|
+
try:
|
44
|
+
dll_path = os.path.split(dll_path)[0] + '/TSMaster.dll'
|
45
|
+
dllPath = os.path.split(dll_path)[0]
|
46
|
+
dll = WinDLL(dll_path)
|
47
|
+
except Exception as r:
|
48
|
+
try:
|
49
|
+
if _arch == '32bit':
|
50
|
+
dll_path = _curr_path + "\\windows\\bin\\TSMaster.dll"
|
51
|
+
else:
|
52
|
+
dll_path = _curr_path + "\\windows\\bin64\\TSMaster.dll"
|
53
|
+
dll = WinDLL(dll_path)
|
54
|
+
except Exception as r:
|
55
|
+
print(r"Could not load the TOSUN DLL from '%s'. Error: %s" % (dll_path, r))
|
56
|
+
else:
|
57
|
+
print(r"Could not load the TOSUN DLL Error: Registry not found")
|
@@ -1,56 +0,0 @@
|
|
1
|
-
'''
|
2
|
-
Author: seven 865762826@qq.com
|
3
|
-
Date: 2023-04-21 11:21:33
|
4
|
-
LastEditors: seven 865762826@qq.com
|
5
|
-
LastEditTime: 2023-11-22 10:26:17
|
6
|
-
'''
|
7
|
-
from ctypes import WinDLL
|
8
|
-
import os
|
9
|
-
import winreg
|
10
|
-
import platform
|
11
|
-
|
12
|
-
TSMaster_location = r"Software\TOSUN\TSMaster"
|
13
|
-
|
14
|
-
_curr_path = os.path.dirname(__file__)
|
15
|
-
|
16
|
-
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, TSMaster_location)
|
17
|
-
|
18
|
-
_arch, _os = platform.architecture()
|
19
|
-
|
20
|
-
i = 0
|
21
|
-
dll_path = ''
|
22
|
-
while True:
|
23
|
-
try:
|
24
|
-
if _arch == '32bit':
|
25
|
-
# 获取注册表对应位置的键和值
|
26
|
-
if winreg.EnumValue(key, i)[0] == 'libTSMaster_x86':
|
27
|
-
dll_path = winreg.EnumValue(key, i)[1]
|
28
|
-
winreg.CloseKey(key)
|
29
|
-
break
|
30
|
-
else:
|
31
|
-
if winreg.EnumValue(key, i)[0] == 'libTSMaster_x64':
|
32
|
-
dll_path = winreg.EnumValue(key, i)[1]
|
33
|
-
winreg.CloseKey(key)
|
34
|
-
break
|
35
|
-
i += 1
|
36
|
-
except OSError as error:
|
37
|
-
# 一定要关闭这个键
|
38
|
-
winreg.CloseKey(key)
|
39
|
-
break
|
40
|
-
|
41
|
-
if dll_path != '':
|
42
|
-
try:
|
43
|
-
dll_path = os.path.split(dll_path)[0] + '/TSMaster.dll'
|
44
|
-
dllPath = os.path.split(dll_path)[0]
|
45
|
-
dll = WinDLL(dll_path)
|
46
|
-
except Exception as r:
|
47
|
-
try:
|
48
|
-
if _arch == '32bit':
|
49
|
-
dll_path = _curr_path + "\\windows\\bin\\TSMaster.dll"
|
50
|
-
else:
|
51
|
-
dll_path = _curr_path + "\\windows\\bin64\\TSMaster.dll"
|
52
|
-
dll = WinDLL(dll_path)
|
53
|
-
except Exception as r:
|
54
|
-
print(r"Could not load the TOSUN DLL from '%s'. Error: %s" % (dll_path, r))
|
55
|
-
else:
|
56
|
-
print(r"Could not load the TOSUN DLL Error: Registry not found")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/windows/bin/TSMaster.dll
RENAMED
File without changes
|
{TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI/windows/bin64/TSMaster.dll
RENAMED
File without changes
|
File without changes
|
{TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/dependency_links.txt
RENAMED
File without changes
|
{TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1170}/TSMasterAPI.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|