src/eric7/MicroPython/Devices/STLinkDevices.py

branch
eric7
changeset 11184
33a600dd86f4
parent 11167
a3f5af773bc7
--- a/src/eric7/MicroPython/Devices/STLinkDevices.py	Fri Mar 21 18:01:35 2025 +0100
+++ b/src/eric7/MicroPython/Devices/STLinkDevices.py	Fri Mar 21 18:11:36 2025 +0100
@@ -46,8 +46,6 @@
 
         self._submitMode = "paste"  # use 'paste' mode
 
-        self.__workspace = self.__findWorkspace()
-
         self.__createSTLinkMenu()
 
     def setButtons(self):
@@ -129,80 +127,6 @@
         """
         return True, ""
 
-    def supportsLocalFileAccess(self):
-        """
-        Public method to indicate file access via a local directory.
-
-        @return flag indicating file access via local directory
-        @rtype bool
-        """
-        return self.__deviceVolumeMounted()
-
-    def __deviceVolumeMounted(self):
-        """
-        Private method to check, if the device volume is mounted.
-
-        @return flag indicated a mounted device
-        @rtype bool
-        """
-        if self.__workspace and not os.path.exists(self.__workspace):
-            self.__workspace = ""  # reset
-
-        return self.DeviceVolumeName in self.getWorkspace(silent=True)
-
-    def getWorkspace(self, silent=False):
-        """
-        Public method to get the workspace directory.
-
-        @param silent flag indicating silent operations
-        @type bool
-        @return workspace directory used for saving files
-        @rtype str
-        """
-        if self.__workspace:
-            # return cached entry
-            return self.__workspace
-        else:
-            self.__workspace = self.__findWorkspace(silent=silent)
-            return self.__workspace
-
-    def __findWorkspace(self, silent=False):
-        """
-        Private method to find the workspace directory.
-
-        @param silent flag indicating silent operations
-        @type bool
-        @return workspace directory used for saving files
-        @rtype str
-        """
-        # Attempts to find the path on the filesystem that represents the
-        # plugged in PyBoard board.
-        deviceDirectories = FileSystemUtilities.findVolume(
-            self.DeviceVolumeName, findAll=True
-        )
-
-        if deviceDirectories:
-            if len(deviceDirectories) == 1:
-                return deviceDirectories[0]
-            else:
-                return self.selectDeviceDirectory(deviceDirectories)
-        else:
-            # return the default workspace and give the user a warning (unless
-            # silent mode is selected)
-            if not silent:
-                EricMessageBox.warning(
-                    self.microPython,
-                    self.tr("Workspace Directory"),
-                    self.tr(
-                        "Python files for STLink boards can be edited in"
-                        " place, if the device volume is locally"
-                        " available. Such a volume was not found. In"
-                        " place editing will not be available."
-                    ),
-                )
-
-            return super().getWorkspace()
-
     def getDocumentationUrl(self):
         """
         Public method to get the device documentation URL.
@@ -477,9 +401,11 @@
         Private slot to reset the connected device.
         """
         if self.microPython.isConnected():
-            self.executeCommands(
+            out, err = self.executeCommands(
                 "import machine\nmachine.reset()\n", mode=self._submitMode
             )
+        if not err:
+            self.microPython.insertData(out + b"\r\n")
 
 
 def createDevice(microPythonWidget, deviceType, _vid, _pid, _boardName, _serialNumber):

eric ide

mercurial