def initializePage(self): model = QStandardItemModel() rootItem = model.invisibleRootItem() # find all the appropriate plugins for export try: for plugin in ExporterPlugin.allExporterPlugins(): item = self.__createStandardItemForPlugin(plugin) if item is not None: rootItem.appendRow(item) except Exception, e: logger.critical("during export, an exception occured: {0}".format(e))
def initializePage(self): model = QStandardItemModel() rootItem = model.invisibleRootItem() # find all the appropriate plugins for export try: for plugin in ExporterPlugin.allExporterPlugins(): item = self.__createStandardItemForPlugin(plugin) if item is not None: rootItem.appendRow(item) except Exception, e: logger.critical( "during export, an exception occured: {0}".format(e))
def _nextId(self): c = self.currentId() if c == WizardPage.INTRO: if self.mode == ScanningMode.SHOW_INTRO: return WizardPage.INTRO if self.mode == ScanningMode.CREATE_NEW: return WizardPage.CREATE_NEW if self.mode == ScanningMode.SELECT_EXISTING: return WizardPage.LIST_OF_EXISTING_SCANS if c == WizardPage.CREATE_NEW: return WizardPage.FIRST_SCAN_PROGRESS if c == WizardPage.FIRST_SCAN_PROGRESS: return WizardPage.SCANNING_COMPLETE_INSTALL_NOW if c == WizardPage.SCANNING_COMPLETE_INSTALL_NOW: # no way to pass this point unless the widget allows it... return self.scanningCompleteInstallNow.nextIdForWizard() if c == WizardPage.LIST_OF_EXISTING_SCANS: isSecondDone = self.field("secondScanComplete").toBool() if isSecondDone: return WizardPage.COMPARE_TWO_SCANS return WizardPage.SECOND_SCAN_PROGRESS if c == WizardPage.SECOND_SCAN_PROGRESS: return WizardPage.COMPARE_TWO_SCANS if c == WizardPage.COMPARE_TWO_SCANS: return WizardPage.SELECT_EXPORT_TYPE if c == WizardPage.SELECT_EXPORT_TYPE: if len(ExporterPlugin.allExporterPlugins()) > 0: return WizardPage.EXPORT_DATA return -1 if c == WizardPage.EXPORT_DATA: return self.exportDataPage.nextId() return -1
def __createPluginNamed(self, plugin_name): if ExporterPlugin.isValidPluginModule(plugin_name): plugin = ExporterPlugin(plugin_name) return plugin return None
def test_mac_pkg_plugin_can_be_found(self): plugin = ExporterPlugin("mac_pkg") self.assertIsNotNone(plugin) self.assertEqual(plugin.name, "Mac Installer PKG") self.assertEqual(plugin.module, "mac_pkg")