taotoolkit 2.0.2__tar.gz → 2.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taotoolkit
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
@@ -19,7 +19,7 @@ Requires-Dist: beautifulsoup4>=4.10.0
19
19
  Requires-Dist: pyyaml>=6.0.3
20
20
  Requires-Dist: pywinpty>=3.0.5; platform_system == "Windows"
21
21
  Provides-Extra: uiautomator
22
- Requires-Dist: uiautomator2>=2.0.2; extra == "uiautomator"
22
+ Requires-Dist: uiautomator2>=2.0.3; extra == "uiautomator"
23
23
 
24
24
  # TAO - Toolkit
25
25
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "taotoolkit"
7
- version = "2.0.2"
7
+ version = "2.0.3"
8
8
  description = "Tao ToolKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -29,5 +29,5 @@ dependencies = [
29
29
 
30
30
  [project.optional-dependencies]
31
31
  uiautomator = [
32
- "uiautomator2>=2.0.2",
32
+ "uiautomator2>=2.0.3",
33
33
  ]
@@ -43,7 +43,7 @@ from .tao_camDvt import camDvtMain as camDvtMain, printHelp as camDvtHelp, CamDv
43
43
 
44
44
  from .asrVrf import Vrf
45
45
 
46
- __version__ = "2.0.2"
46
+ __version__ = "2.0.3"
47
47
 
48
48
  __all__ = [
49
49
  "debugCtrl",
@@ -10,7 +10,7 @@ import time
10
10
  import atexit
11
11
  from functools import wraps
12
12
  from datetime import datetime
13
- from typing import Callable, Dict, List, Optional, Any
13
+ from typing import Callable, Dict, List, Optional, Any, Union, Iterable
14
14
  from colorama import Back, Fore, Style, init
15
15
 
16
16
  try:
@@ -217,20 +217,31 @@ def fileExist(path: str) -> bool:
217
217
  return os.path.exists(path)
218
218
 
219
219
 
220
- def findFilesBySuffixKeyword(path: str, suffix: str, keyword: str) -> List[str]:
220
+ def _normalizeSuffixes(suffix: Union[str, Iterable[str]]) -> tuple:
221
+ """将单个后缀或后缀集合统一为 tuple, 供 str.endswith 使用。"""
222
+ if isinstance(suffix, str):
223
+ return (suffix,)
224
+ return tuple(suffix)
225
+
226
+
227
+ def findFilesBySuffixKeyword(path: str, suffix: Union[str, Iterable[str]], keyword: str) -> List[str]:
228
+ """递归查找以指定后缀结尾(支持1个及以上后缀)且文件名包含关键字的文件。"""
229
+ suffixes = _normalizeSuffixes(suffix)
221
230
  result = []
222
231
  for root, _dirs, files in os.walk(path):
223
232
  for f in files:
224
- if f.endswith(suffix) and keyword in f:
233
+ if f.endswith(suffixes) and keyword in f:
225
234
  result.append(os.path.join(root, f))
226
235
  return result
227
236
 
228
237
 
229
- def findFilesWithSuffix(path: str, suffix: str) -> List[str]:
238
+ def findFilesWithSuffix(path: str, suffix: Union[str, Iterable[str]]) -> List[str]:
239
+ """递归查找以指定后缀结尾的文件, 支持1个及以上后缀。"""
240
+ suffixes = _normalizeSuffixes(suffix)
230
241
  result = []
231
242
  for root, _dirs, files in os.walk(path):
232
243
  for f in files:
233
- if f.endswith(suffix):
244
+ if f.endswith(suffixes):
234
245
  result.append(os.path.join(root, f))
235
246
  return result
236
247
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taotoolkit
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
@@ -19,7 +19,7 @@ Requires-Dist: beautifulsoup4>=4.10.0
19
19
  Requires-Dist: pyyaml>=6.0.3
20
20
  Requires-Dist: pywinpty>=3.0.5; platform_system == "Windows"
21
21
  Provides-Extra: uiautomator
22
- Requires-Dist: uiautomator2>=2.0.2; extra == "uiautomator"
22
+ Requires-Dist: uiautomator2>=2.0.3; extra == "uiautomator"
23
23
 
24
24
  # TAO - Toolkit
25
25
 
@@ -14,4 +14,4 @@ pyyaml>=6.0.3
14
14
  pywinpty>=3.0.5
15
15
 
16
16
  [uiautomator]
17
- uiautomator2>=2.0.2
17
+ uiautomator2>=2.0.3
File without changes
File without changes