Skip to content

Commit ef7f5d5

Browse files
committed
Update au_act_esptool.py
1 parent ff74ca5 commit ef7f5d5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
import esptool # pip install esptool
44

5+
from platform import system
6+
import os
7+
import sys
8+
9+
if (system() == "Darwin"): # Fix for MacOS pyinstaller windowed executable
10+
11+
# Python hackiness: change the path to stub json files in the context of the esptool
12+
# 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")
15+
STUBS_DIR = os.path.join(base_path, "esptool", "targets", "stub_flasher")
16+
exec(
17+
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
18+
esptool.__dict__,
19+
esptool.__dict__,
20+
)
21+
522
#--------------------------------------------------------------------------------------
623
# action testing
724
class AUxEsptoolDetectFlash(AxAction):

0 commit comments

Comments
 (0)