taotoolkit 2.0.6__tar.gz → 2.0.7__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.6
3
+ Version: 2.0.7
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ Description-Content-Type: text/markdown
9
9
  Requires-Dist: chardet>=5.0.0
10
10
  Requires-Dist: colorama>=0.4.5
11
11
  Requires-Dist: func_timeout>=4.3.5
12
- Requires-Dist: Pillow>=9.0.0
12
+ Requires-Dist: Pillow>=9.1.0
13
13
  Requires-Dist: numpy>=1.23.0
14
14
  Requires-Dist: matplotlib>=3.5.0
15
15
  Requires-Dist: opencv-python>=4.5.0
@@ -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.6; extra == "uiautomator"
22
+ Requires-Dist: uiautomator2>=2.0.7; 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.6"
7
+ version = "2.0.7"
8
8
  description = "Tao ToolKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -16,7 +16,7 @@ dependencies = [
16
16
  "chardet>=5.0.0",
17
17
  "colorama>=0.4.5",
18
18
  "func_timeout>=4.3.5",
19
- "Pillow>=9.0.0",
19
+ "Pillow>=9.1.0",
20
20
  "numpy>=1.23.0",
21
21
  "matplotlib>=3.5.0",
22
22
  "opencv-python>=4.5.0",
@@ -29,5 +29,5 @@ dependencies = [
29
29
 
30
30
  [project.optional-dependencies]
31
31
  uiautomator = [
32
- "uiautomator2>=2.0.6",
32
+ "uiautomator2>=2.0.7",
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.6"
46
+ __version__ = "2.0.7"
47
47
 
48
48
  __all__ = [
49
49
  "debugCtrl",
@@ -86,8 +86,8 @@ def fix_windows_encoding():
86
86
  return
87
87
  import ctypes
88
88
 
89
- ctypes.windll.kernel32.SetConsoleOutputCP(65001)
90
- ctypes.windll.kernel32.SetConsoleCP(65001)
89
+ ctypes.windll.kernel32.SetConsoleOutputCP(65001) # type: ignore
90
+ ctypes.windll.kernel32.SetConsoleCP(65001) # type: ignore
91
91
  sys.stdout.reconfigure(encoding="utf-8", errors="replace") # type: ignore
92
92
  sys.stderr.reconfigure(encoding="utf-8", errors="replace") # type: ignore
93
93
 
@@ -98,7 +98,7 @@ def supports_ansi():
98
98
  if sys.platform == "win32":
99
99
  import ctypes
100
100
 
101
- kernel32 = ctypes.windll.kernel32
101
+ kernel32 = ctypes.windll.kernel32 # type: ignore
102
102
  kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
103
103
  return os.environ.get("TERM") != "" or "WT_SESSION" in os.environ or "ANSICON" in os.environ or sys.stdout.isatty()
104
104
  return sys.stdout.isatty()
@@ -14,7 +14,7 @@ from typing import Callable, Dict, List, Optional, Any, Union, Iterable, NoRetur
14
14
  from colorama import Back, Fore, Style, init
15
15
 
16
16
  try:
17
- from winpty import PtyProcess # pip install pywinpty
17
+ from winpty import PtyProcess # type: ignore # pip install pywinpty(仅 Windows)
18
18
  WINPTY_AVAILABLE = True
19
19
  except ImportError:
20
20
  WINPTY_AVAILABLE = False
@@ -266,7 +266,7 @@ def run_as_admin() -> bool:
266
266
  try:
267
267
  import ctypes
268
268
 
269
- return ctypes.windll.shell32.IsUserAnAdmin()
269
+ return ctypes.windll.shell32.IsUserAnAdmin() # type: ignore
270
270
  except Exception:
271
271
  return False
272
272
 
@@ -1308,15 +1308,19 @@ def CLI_scrcpy(argsList):
1308
1308
 
1309
1309
 
1310
1310
  def CLI_power(argsList):
1311
- parser = argparse.ArgumentParser(prog="power", description="android power on/off")
1311
+ parser = argparse.ArgumentParser(prog="po", description="android power on/off")
1312
+ parser.add_argument(
1313
+ "state", nargs="?", default="1", choices=["0", "1"],
1314
+ help="1=打开屏幕(默认), 0=关闭屏幕, 可直接输入(po 0)",
1315
+ )
1312
1316
  parser.add_argument("-s", "--serial", type=str, default="", help="设备SN号(多设备需指定)")
1313
- parser.add_argument("--off", action="store_false", dest="power", help="关闭屏幕")
1314
- parser.set_defaults(power=True)
1317
+ parser.add_argument("--off", action="store_true", help="关闭屏幕(等价于 po 0)")
1315
1318
  args = parser.parse_args(argsList)
1316
1319
 
1320
+ power = args.state != "0" and not args.off
1317
1321
  dev = DevOp(args.serial)
1318
- logi("power on" if args.power else "power off")
1319
- dev.lcdOnAndUnlock(args.power)
1322
+ logi("power on" if power else "power off")
1323
+ dev.lcdOnAndUnlock(power)
1320
1324
 
1321
1325
 
1322
1326
  def CLI_cam(args):
@@ -1332,7 +1336,8 @@ def CLI_cam(args):
1332
1336
 
1333
1337
  def CLI_screenCap(argsList):
1334
1338
  parser = argparse.ArgumentParser(prog="sc", description="android设备截屏")
1335
- parser.add_argument("-f", "--file", default="tmp", help="输出文件名(不含 .png)")
1339
+ parser.add_argument("posFile", nargs="?", default=None, help="输出文件名,可直接输入(sc test)")
1340
+ parser.add_argument("-f", "--file", default=None, help="输出文件名(不含 .png)")
1336
1341
  parser.add_argument("-s", "--serial", default="", help="设备SN号")
1337
1342
  parser.add_argument("-d", "--display", default=None, help="屏幕 Display ID(完整长ID)")
1338
1343
  parser.add_argument("--sub", action="store_true", help="截取副屏")
@@ -1340,6 +1345,8 @@ def CLI_screenCap(argsList):
1340
1345
  parser.add_argument("--hdr", action="store_true", help="启用 HDR 模式(Android 17+)")
1341
1346
  parser.add_argument("--list", action="store_true", help="列出所有屏幕信息")
1342
1347
  args = parser.parse_args(argsList)
1348
+ if args.file is None:
1349
+ args.file = args.posFile if args.posFile is not None else "tmp"
1343
1350
 
1344
1351
  dev = DevOp(args.serial)
1345
1352
  if not dev.isLcdOn():
@@ -1367,7 +1374,8 @@ def CLI_screenCap(argsList):
1367
1374
 
1368
1375
  def CLI_screenRec(argsList):
1369
1376
  parser = argparse.ArgumentParser(prog="screenRec", description="对android设备录屏")
1370
- parser.add_argument("-f", "--file", required=False, default="tmp", help="录制文件名,自动添加后缀.mp4 (默认tmp,可选)")
1377
+ parser.add_argument("posFile", nargs="?", default=None, help="录制文件名,可直接输入(sr test)")
1378
+ parser.add_argument("-f", "--file", required=False, default=None, help="录制文件名,自动添加后缀.mp4 (默认tmp,可选)")
1371
1379
  parser.add_argument("-t", "--time", required=False, default="30", help="录制时间,单位秒 (默认30秒,可选)")
1372
1380
  parser.add_argument("-b", "--bitrate", required=False, default="2", help="录制比特率,单位Mbps (默认2,可选)")
1373
1381
  parser.add_argument("-s", "--serial", type=str, default="", help="设备SN号(多设备需指定)")
@@ -1382,6 +1390,8 @@ def CLI_screenRec(argsList):
1382
1390
  parser.set_defaults(debug=True) # 设置默认值为 True
1383
1391
  parser.set_defaults(showTouch=False)
1384
1392
  args = parser.parse_args(argsList)
1393
+ if args.file is None:
1394
+ args.file = args.posFile if args.posFile is not None else "tmp"
1385
1395
 
1386
1396
  dev = DevOp(args.serial)
1387
1397
  if not dev.isLcdOn():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taotoolkit
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: Tao ToolKit
5
5
  Author-email: taotaoli <taotaoli@asrmicro.com>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ Description-Content-Type: text/markdown
9
9
  Requires-Dist: chardet>=5.0.0
10
10
  Requires-Dist: colorama>=0.4.5
11
11
  Requires-Dist: func_timeout>=4.3.5
12
- Requires-Dist: Pillow>=9.0.0
12
+ Requires-Dist: Pillow>=9.1.0
13
13
  Requires-Dist: numpy>=1.23.0
14
14
  Requires-Dist: matplotlib>=3.5.0
15
15
  Requires-Dist: opencv-python>=4.5.0
@@ -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.6; extra == "uiautomator"
22
+ Requires-Dist: uiautomator2>=2.0.7; extra == "uiautomator"
23
23
 
24
24
  # TAO - Toolkit
25
25
 
@@ -1,7 +1,7 @@
1
1
  chardet>=5.0.0
2
2
  colorama>=0.4.5
3
3
  func_timeout>=4.3.5
4
- Pillow>=9.0.0
4
+ Pillow>=9.1.0
5
5
  numpy>=1.23.0
6
6
  matplotlib>=3.5.0
7
7
  opencv-python>=4.5.0
@@ -14,4 +14,4 @@ pyyaml>=6.0.3
14
14
  pywinpty>=3.0.5
15
15
 
16
16
  [uiautomator]
17
- uiautomator2>=2.0.6
17
+ uiautomator2>=2.0.7
File without changes
File without changes