esptool - neue Versionen

OP #7357652
Lesenswert?

früher gab es esptool.py als Python-Programm, das unter Python2 oder Python3 unter allen OS lief. Jetzt finde ich esptool entweder als diverse ausführbare bin-Programme für Win/Linux/Macs oder als .py, das lädt irgendein Programm herunter - vermutlich wieder ein bin - und führt es aus, beides ist aus Sicherheitsaspekten nicht akzeptabel.

Gibt es neuere esptools wie die Version 4.5 nicht nach wie vor als .py zum Download.

OP #7357666
Lesenswert?

Jack V. schrieb:

https://github.com/espressif/esptool ← guck halt rein, was es macht.

Das ist genau das, was mich stört. Ich suche das echte Python-Programm, keine Binary.

1
#!/usr/bin/env python
2
#
3
# SPDX-FileCopyrightText: 2014-2022 Fredrik Ahlberg, Angus Gratton,
4
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
5
#
6
# SPDX-License-Identifier: GPL-2.0-or-later
7

8
# This executable script is a thin wrapper around the main functionality
9
# in the esptool Python package
10

11
# When updating this script, please also update espefuse.py and espsecure.py
12

13
import contextlib
14
import os
15
import sys
16

17
if os.name != "nt":
18
    # Linux/macOS: remove current script directory to avoid importing this file
19
    # as a module; we want to import the installed esptool module instead
20
    with contextlib.suppress(ValueError):
21
        if sys.path[0].endswith("/bin"):
22
            sys.path.pop(0)
23
        sys.path.remove(os.path.dirname(sys.executable))
24

25
    # Linux/macOS: delete imported module entry to force Python to load
26
    # the module from scratch; this enables importing esptool module in
27
    # other Python scripts
28
    with contextlib.suppress(KeyError):
29
        del sys.modules["esptool"]
30

31
import esptool
32

33
if __name__ == "__main__":
34
    esptool._main()

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren