TSMasterAPI 2024.8.21.1168__tar.gz → 2024.8.22.1171__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.
Files changed (21) hide show
  1. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/PKG-INFO +1 -1
  2. TSMasterAPI-2024.8.22.1171/TSMasterAPI/TSDirver.py +64 -0
  3. TSMasterAPI-2024.8.22.1171/TSMasterAPI/__init__.py +2 -0
  4. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI.egg-info/PKG-INFO +1 -1
  5. TSMasterAPI-2024.8.21.1168/TSMasterAPI/TSDirver.py +0 -56
  6. TSMasterAPI-2024.8.21.1168/TSMasterAPI/__init__.py +0 -2
  7. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/README.rst +0 -0
  8. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSAPI.py +0 -0
  9. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSCallback.py +0 -0
  10. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSEnum.py +0 -0
  11. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSFibex_parse.py +0 -0
  12. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSMasterAPI.py +0 -0
  13. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/TSStruct.py +0 -0
  14. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/windows/bin/TSMaster.dll +0 -0
  15. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI/windows/bin64/TSMaster.dll +0 -0
  16. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI.egg-info/SOURCES.txt +0 -0
  17. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI.egg-info/dependency_links.txt +0 -0
  18. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/TSMasterAPI.egg-info/top_level.txt +0 -0
  19. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/license.txt +0 -0
  20. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/setup.cfg +0 -0
  21. {TSMasterAPI-2024.8.21.1168 → TSMasterAPI-2024.8.22.1171}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TSMasterAPI
3
- Version: 2024.8.21.1168
3
+ Version: 2024.8.22.1171
4
4
  Summary: Use TSMaster hardware
5
5
  Home-page: UNKNOWN
6
6
  Author: seven
@@ -0,0 +1,64 @@
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
+ try:
58
+ if _arch == '32bit':
59
+ dll_path = _curr_path + "\\windows\\bin\\TSMaster.dll"
60
+ else:
61
+ dll_path = _curr_path + "\\windows\\bin64\\TSMaster.dll"
62
+ dll = WinDLL(dll_path)
63
+ except Exception as r:
64
+ print(r"Could not load the TOSUN DLL from '%s'. Error: %s" % (dll_path, r))
@@ -0,0 +1,2 @@
1
+ from .TSAPI import *
2
+ __version__ = 'v2024.8.22.1171'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TSMasterAPI
3
- Version: 2024.8.21.1168
3
+ Version: 2024.8.22.1171
4
4
  Summary: Use TSMaster hardware
5
5
  Home-page: UNKNOWN
6
6
  Author: seven
@@ -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")
@@ -1,2 +0,0 @@
1
- from .TSAPI import *
2
- __version__ = 'v2024.8.21.1168'