xtn-tools-pro 1.0.1.3.3__py3-none-any.whl → 1.0.1.3.5__py3-none-any.whl
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.
- xtn_tools_pro/db/RedisDB.py +4 -5
- xtn_tools_pro/utils/win.py +17 -0
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/METADATA +2 -1
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/RECORD +8 -8
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/LICENSE +0 -0
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/WHEEL +0 -0
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/entry_points.txt +0 -0
- {xtn_tools_pro-1.0.1.3.3.dist-info → xtn_tools_pro-1.0.1.3.5.dist-info}/top_level.txt +0 -0
xtn_tools_pro/db/RedisDB.py
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
# --------------------------------------------------------------------------------------------------
|
9
9
|
# 2024/4/18 xiatn V00.01.000 新建
|
10
10
|
# --------------------------------------------------------------------------------------------------
|
11
|
-
import
|
11
|
+
import time
|
12
|
+
import redis
|
12
13
|
|
13
14
|
|
14
15
|
class RedisDBPro:
|
@@ -31,7 +32,7 @@ class RedisDBPro:
|
|
31
32
|
self.__redis.close()
|
32
33
|
|
33
34
|
@classmethod
|
34
|
-
def from_url(cls, url):
|
35
|
+
def from_url(cls, url, **kwargs):
|
35
36
|
"""
|
36
37
|
|
37
38
|
Args:
|
@@ -40,7 +41,7 @@ class RedisDBPro:
|
|
40
41
|
Returns:
|
41
42
|
|
42
43
|
"""
|
43
|
-
return cls(url=url)
|
44
|
+
return cls(url=url, **kwargs)
|
44
45
|
|
45
46
|
@property
|
46
47
|
def _redis(self):
|
@@ -174,8 +175,6 @@ class RedisDBPro:
|
|
174
175
|
return self._redis.delete(table)
|
175
176
|
|
176
177
|
|
177
|
-
|
178
|
-
|
179
178
|
if __name__ == '__main__':
|
180
179
|
pass
|
181
180
|
# r = RedisDBPro(ip="127.0.0.1", port=6379, db=0, user_pass="xtn-kk")
|
xtn_tools_pro/utils/win.py
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
# --------------------------------------------------------------------------------------------------
|
9
9
|
# 2025/8/11 xiatn V00.01.000 新建
|
10
10
|
# --------------------------------------------------------------------------------------------------
|
11
|
+
import psutil
|
11
12
|
import ctypes
|
12
13
|
from ctypes import wintypes
|
13
14
|
|
@@ -75,6 +76,22 @@ def enum_windows(only_visible=True):
|
|
75
76
|
return results
|
76
77
|
|
77
78
|
|
79
|
+
def kill_process_by_name(process_name, x=False):
|
80
|
+
"""
|
81
|
+
遍历根据进程名杀死所有相关进程
|
82
|
+
:param process_name:
|
83
|
+
:return:
|
84
|
+
"""
|
85
|
+
for proc in psutil.process_iter(['pid', 'name']):
|
86
|
+
try:
|
87
|
+
if proc.info['name'] and process_name.lower() in proc.info['name'].lower():
|
88
|
+
if x:
|
89
|
+
print(f"Killing process: {proc.info['name']} (PID: {proc.info['pid']})")
|
90
|
+
proc.kill()
|
91
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
92
|
+
continue
|
93
|
+
|
94
|
+
|
78
95
|
if __name__ == "__main__":
|
79
96
|
pass
|
80
97
|
# 枚举win窗口获取句柄和pid
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: xtn-tools-pro
|
3
|
-
Version: 1.0.1.3.
|
3
|
+
Version: 1.0.1.3.5
|
4
4
|
Summary: xtn 开发工具
|
5
5
|
Author: xtn
|
6
6
|
Author-email: czw011122@gmail.com
|
@@ -20,5 +20,6 @@ Requires-Dist: tqdm
|
|
20
20
|
Requires-Dist: fabric
|
21
21
|
Requires-Dist: pyotp
|
22
22
|
Requires-Dist: pycryptodome
|
23
|
+
Requires-Dist: psutil
|
23
24
|
|
24
25
|
xtnkk-tools
|
@@ -4,7 +4,7 @@ xtn_tools_pro/tools_flie.py,sha256=-FID31G8AnV2u2djRO3Ae3Ei9ld9bSBWgzwqhYzZ5JQ,1
|
|
4
4
|
xtn_tools_pro/tools_time.py,sha256=DMjsw9h4E_mrPsanPA8CEhpUE1AA6Z2FU4OJqJKZc1k,4867
|
5
5
|
xtn_tools_pro/db/MongoDB.py,sha256=CljtA5NnutOPL0j2ClrCE4RXW-9N_306D3PAdRANmuk,5699
|
6
6
|
xtn_tools_pro/db/MysqlDB.py,sha256=SBJrcjbZdxmtTKPGwl57NthPhs4uX8J3P6o_rK01O4k,13373
|
7
|
-
xtn_tools_pro/db/RedisDB.py,sha256=
|
7
|
+
xtn_tools_pro/db/RedisDB.py,sha256=xi5YcMP2LISASpzyxA2r2c_5GYocMKqBrdZJJtwRZMA,6493
|
8
8
|
xtn_tools_pro/db/__init__.py,sha256=Zg91UWS02TO0Ba_0AY56s0oabRy93xLNFkpIIL_6mMM,416
|
9
9
|
xtn_tools_pro/flask_demo/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
10
10
|
xtn_tools_pro/flask_demo/cli.py,sha256=wBcdWu5uN1QB8begyGHnhSln4IiZJPTFE8CDy0sQGTk,3116
|
@@ -64,10 +64,10 @@ xtn_tools_pro/utils/set_data.py,sha256=UR5S8xBqc4Vk8zpbrNVsxKhwaBAenaEdC7O-N3s7h
|
|
64
64
|
xtn_tools_pro/utils/shell.py,sha256=s6sJedxLLQokcI1hF5YSD3qgGUPK0brNcP-D3-yv54I,3790
|
65
65
|
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
66
66
|
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
67
|
-
xtn_tools_pro/utils/win.py,sha256=
|
68
|
-
xtn_tools_pro-1.0.1.3.
|
69
|
-
xtn_tools_pro-1.0.1.3.
|
70
|
-
xtn_tools_pro-1.0.1.3.
|
71
|
-
xtn_tools_pro-1.0.1.3.
|
72
|
-
xtn_tools_pro-1.0.1.3.
|
73
|
-
xtn_tools_pro-1.0.1.3.
|
67
|
+
xtn_tools_pro/utils/win.py,sha256=D5_58WMKOGe9ZwJuJr2JGAWmVISwMOZUx4t7wXUCviU,3512
|
68
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
69
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/METADATA,sha256=XJ9HwH6MUpFePT4Qy0x7kxuposgvKUXdgJxei0_5wWs,597
|
70
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
71
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
72
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
73
|
+
xtn_tools_pro-1.0.1.3.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|