sdev 0.6.2__tar.gz → 0.6.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.
- {sdev-0.6.2/sdev.egg-info → sdev-0.6.3}/PKG-INFO +1 -1
- {sdev-0.6.2 → sdev-0.6.3}/pyproject.toml +1 -1
- {sdev-0.6.2 → sdev-0.6.3}/sdev/__init__.py +1 -1
- {sdev-0.6.2 → sdev-0.6.3}/sdev/cli/cli_wrapper.py +9 -1
- {sdev-0.6.2 → sdev-0.6.3/sdev.egg-info}/PKG-INFO +1 -1
- {sdev-0.6.2 → sdev-0.6.3}/setup.py +1 -1
- {sdev-0.6.2 → sdev-0.6.3}/LICENSE +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/MANIFEST.in +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/README.md +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/base/__init__.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/base/serial_core.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/cli/__init__.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/models/__init__.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/models/demoboard.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/remote/__init__.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/remote/board_list.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/remote/client.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/remote/discovery.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/remote/server.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev/util.py +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev.egg-info/SOURCES.txt +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev.egg-info/dependency_links.txt +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev.egg-info/entry_points.txt +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev.egg-info/requires.txt +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/sdev.egg-info/top_level.txt +0 -0
- {sdev-0.6.2 → sdev-0.6.3}/setup.cfg +0 -0
|
@@ -382,6 +382,8 @@ def cmd_shell(args: argparse.Namespace) -> int:
|
|
|
382
382
|
|
|
383
383
|
# 若未显式指定 --timeout,则默认等待 60 秒,避免长命令过早被认为超时。
|
|
384
384
|
effective_timeout: Optional[float] = args.timeout if args.timeout is not None else 60.0
|
|
385
|
+
# Ctrl-C / 超时后的「收尾」等待不需要这么久,单独使用较短的间隔。
|
|
386
|
+
interrupt_timeout: Optional[float] = min(effective_timeout, 5.0) if effective_timeout is not None else 5.0
|
|
385
387
|
|
|
386
388
|
with Demoboard(port, baudrate, host=host) as board:
|
|
387
389
|
try:
|
|
@@ -392,13 +394,19 @@ def cmd_shell(args: argparse.Namespace) -> int:
|
|
|
392
394
|
try:
|
|
393
395
|
board.send_interrupt()
|
|
394
396
|
# 不再发送新命令,仅等待当前提示符出现作为“收尾”信号。
|
|
395
|
-
_ = board.execute_command(None, flag=args.flag, timeout=
|
|
397
|
+
_ = board.execute_command(None, flag=args.flag, timeout=interrupt_timeout)
|
|
396
398
|
except Exception:
|
|
397
399
|
pass
|
|
398
400
|
print() # 保证光标回到新行
|
|
399
401
|
return 130 # 约定:被 Ctrl-C 中断
|
|
400
402
|
except TimeoutError as e:
|
|
403
|
+
# 命令执行超时时,自动向板子发送一次 Ctrl-C,并尝试等提示符收尾。
|
|
401
404
|
print(e, file=sys.stderr)
|
|
405
|
+
try:
|
|
406
|
+
board.send_interrupt()
|
|
407
|
+
_ = board.execute_command(None, flag=args.flag, timeout=interrupt_timeout)
|
|
408
|
+
except Exception:
|
|
409
|
+
pass
|
|
402
410
|
return 1
|
|
403
411
|
print()
|
|
404
412
|
# sys.stdout.flush()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|