eric7/MicroPython/EspDevices.py

branch
eric7
changeset 9016
6f079c524e99
parent 8945
b6be65111565
diff -r dfeefad914ed -r 6f079c524e99 eric7/MicroPython/EspDevices.py
--- a/eric7/MicroPython/EspDevices.py	Sun Apr 03 17:23:31 2022 +0200
+++ b/eric7/MicroPython/EspDevices.py	Mon Apr 04 17:43:43 2022 +0200
@@ -8,8 +8,6 @@
 boards.
 """
 
-import sys
-
 from PyQt6.QtCore import pyqtSlot, QProcess
 from PyQt6.QtWidgets import QDialog
 
@@ -20,6 +18,7 @@
 from .MicroPythonDevices import MicroPythonDevice
 from .MicroPythonWidget import HAS_QTCHART
 
+import Globals
 import Preferences
 
 
@@ -187,7 +186,7 @@
             dlg = EricProcessDialog(self.tr("'esptool erase_flash' Output"),
                                     self.tr("Erase Flash"),
                                     showProgress=True)
-            res = dlg.startProcess(sys.executable, flashArgs)
+            res = dlg.startProcess(Globals.getPythonExecutable(), flashArgs)
             if res:
                 dlg.exec()
     
@@ -222,7 +221,7 @@
             dlg = EricProcessDialog(self.tr("'esptool write_flash' Output"),
                                     self.tr("Flash MicroPython Firmware"),
                                     showProgress=True)
-            res = dlg.startProcess(sys.executable, flashArgs)
+            res = dlg.startProcess(Globals.getPythonExecutable(), flashArgs)
             if res:
                 dlg.exec()
     
@@ -257,7 +256,7 @@
             dlg = EricProcessDialog(self.tr("'esptool write_flash' Output"),
                                     self.tr("Flash Additional Firmware"),
                                     showProgress=True)
-            res = dlg.startProcess(sys.executable, flashArgs)
+            res = dlg.startProcess(Globals.getPythonExecutable(), flashArgs)
             if res:
                 dlg.exec()
     
@@ -285,7 +284,7 @@
             dlg = EricProcessDialog(self.tr("'esptool read_flash' Output"),
                                     self.tr("Backup Firmware"),
                                     showProgress=True)
-            res = dlg.startProcess(sys.executable, flashArgs)
+            res = dlg.startProcess(Globals.getPythonExecutable(), flashArgs)
             if res:
                 dlg.exec()
     
@@ -323,7 +322,7 @@
             dlg = EricProcessDialog(self.tr("'esptool write_flash' Output"),
                                     self.tr("Restore Firmware"),
                                     showProgress=True)
-            res = dlg.startProcess(sys.executable, flashArgs)
+            res = dlg.startProcess(Globals.getPythonExecutable(), flashArgs)
             if res:
                 dlg.exec()
     
@@ -340,7 +339,7 @@
         ]
         dlg = EricProcessDialog(self.tr("'esptool chip_id' Output"),
                                 self.tr("Show Chip ID"))
-        res = dlg.startProcess(sys.executable, args)
+        res = dlg.startProcess(Globals.getPythonExecutable(), args)
         if res:
             dlg.exec()
     
@@ -357,7 +356,7 @@
         ]
         dlg = EricProcessDialog(self.tr("'esptool flash_id' Output"),
                                 self.tr("Show Flash ID"))
-        res = dlg.startProcess(sys.executable, args)
+        res = dlg.startProcess(Globals.getPythonExecutable(), args)
         if res:
             dlg.exec()
     
@@ -374,7 +373,7 @@
         ]
         dlg = EricProcessDialog(self.tr("'esptool read_mac' Output"),
                                 self.tr("Show MAC Address"))
-        res = dlg.startProcess(sys.executable, args)
+        res = dlg.startProcess(Globals.getPythonExecutable(), args)
         if res:
             dlg.exec()
     
@@ -398,7 +397,7 @@
                 "flash_id"
             ]
             proc = QProcess()
-            proc.start(sys.executable, args)
+            proc.start(Globals.getPythonExecutable(), args)
             procStarted = proc.waitForStarted(10000)
             if procStarted:
                 proc.waitForFinished(10000)
@@ -409,7 +408,8 @@
         Private slot to install the esptool package via pip.
         """
         pip = ericApp().getObject("Pip")
-        pip.installPackages(["esptool"], interpreter=sys.executable)
+        pip.installPackages(["esptool"],
+                            interpreter=Globals.getPythonExecutable())
     
     def getDocumentationUrl(self):
         """

eric ide

mercurial