1 Star 0 Fork 0

kangchi/esptool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
espefuse.py 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env python
#
# SPDX-FileCopyrightText: 2014-2022 Fredrik Ahlberg, Angus Gratton,
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# This executable script is a thin wrapper around the main functionality
# in the espefuse Python package
# When updating this script, please also update esptool.py and espsecure.py
import contextlib
import os
import sys
if os.name != "nt":
# Linux/macOS: remove current script directory to avoid importing this file
# as a module; we want to import the installed espefuse module instead
with contextlib.suppress(ValueError):
executable_dir = os.path.dirname(sys.executable)
sys.path = [
path
for path in sys.path
if not path.endswith(("/bin", "/sbin")) and path != executable_dir
]
# Linux/macOS: delete imported module entry to force Python to load
# the module from scratch; this enables importing espefuse module in
# other Python scripts
with contextlib.suppress(KeyError):
del sys.modules["espefuse"]
import espefuse
if __name__ == "__main__":
espefuse._main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kangchi/esptool.git
git@gitee.com:kangchi/esptool.git
kangchi
esptool
esptool
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385