def _load_default_pr_filter(self): if self.PrDefaultFilter.interior: # Filter already loaded return f = QFile(Resource.icon_paths.get('pr_data')) try: f.open(QIODevice.ReadOnly) data: QByteArray = f.readAll() data: bytes = data.data() Settings.load_json_from_bytes(self.PrDefaultFilter, data) except Exception as e: LOGGER.error(e) finally: f.close()
def _load_default_filter(self): """ Read Package default filter from qt resources """ f = QFile(Resource.icon_paths.get('pr_data')) try: f.open(QIODevice.ReadOnly) data: QByteArray = f.readAll() data: bytes = data.data() Settings.load_json_from_bytes(PrJsonData, data) except Exception as e: LOGGER.error(e) finally: f.close() self.data.pkg_filter = PrJsonData.package_filter[::] self.automagic_filter = set(PrJsonData.wizard_automagic_filter) # Update Start Page Package Widget if hasattr(self.wizard, 'page_welcome'): self.wizard.page_welcome.reload_pkg_filter()