diff -r 1208cdae96b6 -r a467ab075be0 eric6/MicroPython/MicrobitDevices.py --- a/eric6/MicroPython/MicrobitDevices.py Thu Feb 04 14:35:50 2021 +0100 +++ b/eric6/MicroPython/MicrobitDevices.py Thu Feb 04 14:38:01 2021 +0100 @@ -42,8 +42,6 @@ super(MicrobitDevice, self).__init__(microPythonWidget, parent) self.__deviceType = deviceType - - self.__workspace = self.__findWorkspace() def setButtons(self): """ @@ -127,52 +125,6 @@ """ return True, "" - def getWorkspace(self): - """ - Public method to get the workspace directory. - - @return workspace directory used for saving files - @rtype str - """ - if self.__workspace: - # return cached entry - return self.__workspace - else: - self.__workspace = self.__findWorkspace() - return self.__workspace - - def __findWorkspace(self): - """ - Public method to find the workspace directory. - - @return workspace directory used for saving files - @rtype str - """ - # Attempts to find the path on the filesystem that represents the - # plugged in MICROBIT or MINI board. - if self.__deviceType == "bbc_microbit": - # BBC micro:bit - deviceDirectories = Utilities.findVolume("MICROBIT", all=True) - else: - # Calliope mini - deviceDirectories = Utilities.findVolume("MINI", all=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 - E5MessageBox.warning( - self.microPython, - self.tr("Workspace Directory"), - self.tr("Could not find an attached {0}.\n\n" - "Please make sure the device is plugged " - "into this computer.").format(self.deviceName())) - - return super(MicrobitDevice, self).getWorkspace() - def hasTimeCommands(self): """ Public method to check, if the device supports time commands. @@ -230,17 +182,18 @@ # BBC micro:bit if firmware: deviceDirectories = Utilities.findVolume("MAINTENANCE", - all=True) + findAll=True) else: deviceDirectories = Utilities.findVolume("MICROBIT", - all=True) + findAll=True) else: # Calliope mini if firmware: deviceDirectories = Utilities.findVolume("MAINTENANCE", - all=True) + findAll=True) else: - deviceDirectories = Utilities.findVolume("MINI", all=True) + deviceDirectories = Utilities.findVolume("MINI", + findAll=True) if len(deviceDirectories) == 0: if self.__deviceType == "bbc_microbit": # BBC micro:bit is not ready or not mounted