Skip to content

Commit c924845

Browse files
committed
More MacOS stub_flasher tweaks
1 parent d3f2a0f commit c924845

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

RTK_Firmware_Uploader/RTK_Firmware_Uploader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ def on_upload_btn_pressed(self) -> None:
460460
except:
461461
pass
462462

463+
464+
base_path = os.path.abspath(path.dirname(__file__))
465+
self.writeMessage(base_path)
466+
463467
self.flashSize = 0
464468

465469
self.writeMessage("Detecting flash size\n\n")

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
import esptool # pip install esptool
44

55
from platform import system
6-
import os
7-
import sys
6+
import os.path
87

9-
if (system() == "Darwin") and hasattr(sys, '_MEIPASS'): # Fix for MacOS pyinstaller windowed executable
8+
if (system() == "Darwin"): # Fix for MacOS pyinstaller windowed executable
109

1110
# Python hackiness: change the path to stub json files in the context of the esptool
1211
# module, so it edits the esptool's global variables
13-
base_path = getattr(sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__)))
14-
STUBS_DIR = os.path.join(base_path, "..", "Resources", "esptool", "targets", "stub_flasher")
12+
base_path = os.path.abspath(path.dirname(__file__))
13+
STUBS_DIR = os.path.join(base_path, "..", "Frameworks", "esptool", "targets", "stub_flasher")
1514
exec(
1615
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
1716
esptool.__dict__,

0 commit comments

Comments
 (0)