Update: 更新esptool ( version: 4.7.0 )

This commit is contained in:
王立帮
2024-09-01 12:36:51 +08:00
parent caf26e2fbc
commit 557a035010
37 changed files with 4733 additions and 185 deletions

View File

@@ -34,6 +34,8 @@ def flash_size_bytes(size):
"""Given a flash size of the type passed in args.flash_size
(ie 512KB or 1MB) then return the size in bytes.
"""
if size is None:
return None
if "MB" in size:
return int(size[: size.index("MB")]) * 1024 * 1024
elif "KB" in size:
@@ -66,7 +68,7 @@ def print_overwrite(message, last_line=False):
If output is not a TTY (for example redirected a pipe),
no overwriting happens and this function is the same as print().
"""
if sys.stdout.isatty():
if hasattr(sys.stdout, "isatty") and sys.stdout.isatty():
print("\r%s" % message, end="\n" if last_line else "")
else:
print(message)
@@ -165,7 +167,7 @@ class NotSupportedError(FatalError):
def __init__(self, esp, function_name):
FatalError.__init__(
self,
"Function %s is not supported for %s." % (function_name, esp.CHIP_NAME),
f"{function_name} is not supported by {esp.CHIP_NAME}.",
)