160 self.__workspace = self.__findWorkspace(silent=silent) |
160 self.__workspace = self.__findWorkspace(silent=silent) |
161 return self.__workspace |
161 return self.__workspace |
162 |
162 |
163 def __findWorkspace(self, silent=False): |
163 def __findWorkspace(self, silent=False): |
164 """ |
164 """ |
165 Public method to find the workspace directory. |
165 Private method to find the workspace directory. |
166 |
166 |
167 @param silent flag indicating silent operations |
167 @param silent flag indicating silent operations |
168 @type bool |
168 @type bool |
169 @return workspace directory used for saving files |
169 @return workspace directory used for saving files |
170 @rtype str |
170 @rtype str |
171 """ |
171 """ |
172 # Attempts to find the path on the filesystem that represents the |
172 # Attempts to find the path on the filesystem that represents the |
173 # plugged in PyBoard board. |
173 # plugged in PyBoard board. |
174 deviceDirectories = Utilities.findVolume(self.DeviceVolumeName, |
174 deviceDirectories = Utilities.findVolume(self.DeviceVolumeName, |
175 all=True) |
175 findAll=True) |
176 |
176 |
177 if deviceDirectories: |
177 if deviceDirectories: |
178 if len(deviceDirectories) == 1: |
178 if len(deviceDirectories) == 1: |
179 return deviceDirectories[0] |
179 return deviceDirectories[0] |
180 else: |
180 else: |
184 # silent mode is selected) |
184 # silent mode is selected) |
185 if not silent: |
185 if not silent: |
186 E5MessageBox.warning( |
186 E5MessageBox.warning( |
187 self.microPython, |
187 self.microPython, |
188 self.tr("Workspace Directory"), |
188 self.tr("Workspace Directory"), |
189 self.tr("Python files for PyBoard devices are stored" |
189 self.tr("Python files for PyBoard can be edited in" |
190 " on the device. Therefore, to edit these files" |
190 " place, if the device volume is locally" |
191 " you need to have the device plugged in. Until" |
191 " available. Such a volume was not found. In" |
192 " you plug in a device, the standard directory" |
192 " place editing will not be available." |
193 " will be used.")) |
193 ) |
|
194 ) |
194 |
195 |
195 return super(PyBoardDevice, self).getWorkspace() |
196 return super(PyBoardDevice, self).getWorkspace() |
196 |
197 |
197 def getDocumentationUrl(self): |
198 def getDocumentationUrl(self): |
198 """ |
199 """ |