Skip to content

Commit a4eaa98

Browse files
committed
More MacOS stub_flasher tweaks
1 parent 5222ae5 commit a4eaa98

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

RTK_Firmware_Uploader/RTK_Firmware_Uploader.py

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

463-
464-
head_tail = os.path.split(os.path.dirname(__file__))
465-
base_path = os.path.abspath(head_tail[0])
466-
self.writeMessage(base_path)
467-
self.writeMessage(head_tail[1])
468-
469463
self.flashSize = 0
470464

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

RTK_Firmware_Uploader/au_act_esptool.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88
if (system() == "Darwin"): # Fix for MacOS pyinstaller windowed executable
99

1010
head_tail = os.path.split(os.path.dirname(__file__))
11-
if (head_tail[1] == "RTK_Firmware_Uploader"): # Check if this is the Uploader executable
12-
base_path = os.path.abspath(head_tail[0])
13-
STUBS_DIR = os.path.join(base_path, "esptool", "targets", "stub_flasher")
14-
# Python hackiness: change the path to stub json files in the context of the esptool
15-
# module, so it edits the esptool's global variables
16-
exec(
17-
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
18-
esptool.__dict__,
19-
esptool.__dict__,
20-
)
11+
base_path = os.path.abspath(head_tail[0])
12+
STUBS_DIR = os.path.join(base_path, "esptool", "targets", "stub_flasher")
13+
# Python hackiness: change the path to stub json files in the context of the esptool
14+
# module, so it edits the esptool's global variables
15+
exec(
16+
"loader.STUBS_DIR = '{}'".format(STUBS_DIR),
17+
esptool.__dict__,
18+
esptool.__dict__,
19+
)
2120

2221
#--------------------------------------------------------------------------------------
2322
# action testing

0 commit comments

Comments
 (0)