feat(core): 更新py-esptool (version: 4.8.1)

This commit is contained in:
王立帮
2025-04-07 23:51:29 +08:00
parent 6b4ca0a883
commit 937ecf44f4
120 changed files with 1871 additions and 8899 deletions

24
tools/python/ampy_main.py Normal file
View File

@@ -0,0 +1,24 @@
import sys
from ampy.cli import cli, _board
if __name__ == "__main__":
error_exit = False
try:
cli()
except BaseException as e:
if getattr(e, 'code', True):
print('Error: {}'.format(e))
error_exit = True
finally:
# Try to ensure the board serial connection is always gracefully closed.
if _board is not None:
try:
_board.close()
except:
# Swallow errors when attempting to close as it's just a best effort
# and shouldn't cause a new error or problem if the connection can't
# be closed.
pass
if error_exit:
sys.exit(1)