src/eric7/MicroPython/Devices/DeviceBase.py

branch
mpy_network
changeset 9803
2ab3de60b51c
parent 9802
22aeee2bf35f
child 9808
b68af9fd6a7a
equal deleted inserted replaced
9802:22aeee2bf35f 9803:2ab3de60b51c
137 if key is None: 137 if key is None:
138 return copy.deepcopy(self._deviceData) 138 return copy.deepcopy(self._deviceData)
139 else: 139 else:
140 return self._deviceData[key] 140 return self._deviceData[key]
141 141
142 def checkDeviceData(self): 142 def checkDeviceData(self, quiet=True):
143 """ 143 """
144 Public method to check the validity of the device data determined during 144 Public method to check the validity of the device data determined during
145 connecting the device. 145 connecting the device.
146 146
147 @param quiet flag indicating to not show an info message, if the data is
148 not available (defaults to True)
149 @type bool (optional)
147 @return flag indicating valid device data 150 @return flag indicating valid device data
148 @rtype bool 151 @rtype bool
149 """ 152 """
150 if bool(self._deviceData): 153 if bool(self._deviceData):
151 return True 154 return True
152 else: 155 else:
153 EricMessageBox.critical( 156 if not quiet:
154 None, 157 EricMessageBox.critical(
155 self.tr("Show MicroPython Versions"), 158 None,
156 self.tr( 159 self.tr("Device Data Not Available"),
157 """<p>The device data is not available. Try to connect to the""" 160 self.tr(
158 """ device again. Aborting...</p>""" 161 """<p>The device data is not available. Try to connect to the"""
159 ).format(self.getDeviceType()), 162 """ device again. Aborting...</p>"""
160 ) 163 ).format(self.getDeviceType()),
164 )
161 return False 165 return False
162 166
163 def hasCircuitPython(self): 167 def hasCircuitPython(self):
164 """ 168 """
165 Public method to check, if the connected device is flashed with CircuitPython. 169 Public method to check, if the connected device is flashed with CircuitPython.

eric ide

mercurial