eric6/MicroPython/CircuitPythonDevices.py

changeset 7174
de8175253dfc
parent 7161
728018c32b09
child 7229
53054eb5b15a
--- a/eric6/MicroPython/CircuitPythonDevices.py	Mon Aug 26 12:43:26 2019 +0200
+++ b/eric6/MicroPython/CircuitPythonDevices.py	Mon Aug 26 18:41:48 2019 +0200
@@ -137,12 +137,14 @@
         @return flag indicated a mounted device
         @rtype bool
         """
-        return self.getWorkspace().endswith(self.DeviceVolumeName)
+        return self.getWorkspace(silent=True).endswith(self.DeviceVolumeName)
     
-    def getWorkspace(self):
+    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
         """
@@ -153,14 +155,17 @@
         if deviceDirectory:
             return deviceDirectory
         else:
-            # return the default workspace and give the user a warning
-            E5MessageBox.warning(
-                self.microPython,
-                self.tr("Workspace Directory"),
-                self.tr("Python files for CircuitPython devices are stored on"
-                        " the device. Therefore, to edit these files you need"
-                        " to have the device plugged in. Until you plug in a"
-                        " device, the standard directory will be used."))
+            # return the default workspace and give the user a warning (unless
+            # silent mode is selected)
+            if not silent:
+                E5MessageBox.warning(
+                    self.microPython,
+                    self.tr("Workspace Directory"),
+                    self.tr("Python files for CircuitPython devices are stored"
+                            " on the device. Therefore, to edit these files"
+                            " you need to have the device plugged in. Until"
+                            " you plug in a device, the standard directory"
+                            " will be used."))
             
             return super(CircuitPythonDevice, self).getWorkspace()
     

eric ide

mercurial