From 247f96e2ba39a740f50c09f0b440d9c6c1d1acc7 Mon Sep 17 00:00:00 2001 From: andreas Date: Sun, 5 Nov 2023 18:52:15 +0100 Subject: [PATCH] further restructuring of flashtool --- tools/flashtool/flasher.py | 8 +++++--- tools/flashtool/flashtool.py | 2 +- tools/flashtool/version.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 tools/flashtool/version.py diff --git a/tools/flashtool/flasher.py b/tools/flashtool/flasher.py index db2708f..a063264 100644 --- a/tools/flashtool/flasher.py +++ b/tools/flashtool/flasher.py @@ -1,7 +1,9 @@ - -import flashtool.esptool as esptool +try: + import esptool +except: + import flashtool.esptool as esptool import os -from flashtool.version import VERSION +VERSION="2.1" class Flasher(): def getVersion(self): diff --git a/tools/flashtool/flashtool.py b/tools/flashtool/flashtool.py index e995478..a64bf9e 100755 --- a/tools/flashtool/flashtool.py +++ b/tools/flashtool/flashtool.py @@ -26,7 +26,7 @@ class MyFinder(importlib.abc.MetaPathFinder): def find_spec(self,fullname, path, target=None): if fullname == self.pkg: if self.debug: - print("F:matching %"%fullname) + print("F:matching %s"%fullname) spec=importlib.util.spec_from_file_location(fullname, self.dir,loader=MyLoader(), submodule_search_locations=[self.dir]) if self.debug: print("F:injecting:",spec) diff --git a/tools/flashtool/version.py b/tools/flashtool/version.py deleted file mode 100644 index ceda338..0000000 --- a/tools/flashtool/version.py +++ /dev/null @@ -1 +0,0 @@ -VERSION="2.1" \ No newline at end of file