36 @param pid product ID |
36 @param pid product ID |
37 @type int |
37 @type int |
38 @param parent reference to the parent object |
38 @param parent reference to the parent object |
39 @type QObject |
39 @type QObject |
40 """ |
40 """ |
41 super(GenericMicroPythonDevice, self).__init__( |
41 super().__init__( |
42 microPythonWidget, deviceType, parent) |
42 microPythonWidget, deviceType, parent) |
43 |
43 |
44 self.__directAccess = False |
44 self.__directAccess = False |
45 self.__deviceVolumeName = "" |
45 self.__deviceVolumeName = "" |
46 self.__workspace = "" |
46 self.__workspace = "" |
60 |
60 |
61 def setButtons(self): |
61 def setButtons(self): |
62 """ |
62 """ |
63 Public method to enable the supported action buttons. |
63 Public method to enable the supported action buttons. |
64 """ |
64 """ |
65 super(GenericMicroPythonDevice, self).setButtons() |
65 super().setButtons() |
66 self.microPython.setActionButtons( |
66 self.microPython.setActionButtons( |
67 run=True, repl=True, files=True, chart=HAS_QTCHART) |
67 run=True, repl=True, files=True, chart=HAS_QTCHART) |
68 |
68 |
69 if self.__directAccess and self.__deviceVolumeMounted(): |
69 if self.__directAccess and self.__deviceVolumeMounted(): |
70 self.microPython.setActionButtons(open=True, save=True) |
70 self.microPython.setActionButtons(open=True, save=True) |
167 return self.__workspace |
167 return self.__workspace |
168 else: |
168 else: |
169 self.__workspace = self.__findWorkspace(silent=silent) |
169 self.__workspace = self.__findWorkspace(silent=silent) |
170 return self.__workspace |
170 return self.__workspace |
171 else: |
171 else: |
172 return super(GenericMicroPythonDevice, self).getWorkspace() |
172 return super().getWorkspace() |
173 |
173 |
174 def __findWorkspace(self, silent=False): |
174 def __findWorkspace(self, silent=False): |
175 """ |
175 """ |
176 Private method to find the workspace directory. |
176 Private method to find the workspace directory. |
177 |
177 |