def back_to_factory_defaults(self): self._Procedures.reset_to_factory_defaults() for device in self._devices_pool: device.stop() self.clear_device_pool() devutils.save(self._devices_pool, self._pool_dump_path) return True
def remove_device(self, short_id, long_id=0): short_id = int(short_id, 0) device = self._find_device(short_id, 0) if not device: log.write("Can't found such device") return False device.stop() result = self._Procedures.remove_device(short_id) self._devices_pool.remove(device) devutils.save(self._devices_pool, self._pool_dump_path) if not result: log.write("Can't delete device") return False #log.write("device_idx=" + str(device_idx)) device.stop() #log.write("Device stoped, is alive = " + str(device._ka_thread.isAlive())) self._devices_pool.remove(device) del(device) devutils.save(self._devices_pool, self._pool_dump_path) return True
def _add_device(self, Device): self._devices_pool.append(Device) devutils.save(self._devices_pool, self._pool_dump_path)
def clear_device_pool(self): del self._devices_pool[:] devutils.save(self._devices_pool, self._pool_dump_path)
def remove_all_devices(self): result = self._Procedures.remove_device(0xFF) for device in self._devices_pool: device.stop() self.clear_device_pool() devutils.save(self._devices_pool, self._pool_dump_path)