def beginChangesScan(self, doc_name): """ Find the selected item, and use the directories inside to perform a scan, the merge the results of that with the existing document - forming a set of objects that have been added/changed/removed """ # now fetch the data model for that one to get the paths that need to be scanned self.storage = PersistentScanningState(DocumentStorage.documentFullPath(doc_name)) #return self.__beginChangesScanWithDocument() self.__beginChangesScanWithDocument()
def test_model_directory_can_be_created(self): # ensure a fake file is listed inside the data model directory f = open(DocumentStorage.documentFullPath('test.sqlite'), "w") f.write("something") f.close() all_docs = DocumentStorage.documents() for a_doc in all_docs: if 'test.sqlite' in a_doc: return raise SystemError("Failure - expected test.sqlite to be in these docs somewhere")
def beginChangesScan(self, doc_name): """ Find the selected item, and use the directories inside to perform a scan, the merge the results of that with the existing document - forming a set of objects that have been added/changed/removed """ # now fetch the data model for that one to get the paths that need to be scanned self.storage = PersistentScanningState( DocumentStorage.documentFullPath(doc_name)) #return self.__beginChangesScanWithDocument() self.__beginChangesScanWithDocument()
def initializePage(self): name_of_file = self.wizard().documentName() self.__refreshResultsUsingDocument(PersistentScanningState(DocumentStorage.documentFullPath(name_of_file))) self.wizard().removePage(WizardPage.CREATE_NEW) self.wizard().removePage(WizardPage.FIRST_SCAN_PROGRESS) self.wizard().removePage(WizardPage.SECOND_SCAN_PROGRESS) self.wizard().removePage(WizardPage.SCANNING_COMPLETE_INSTALL_NOW) self.wizard().reinsertCreateScanPage()
def isComplete(self): done = self.document_name is not None if done: # if the second scan completed OK, we can skip the second scan fullpath_doc_name = DocumentStorage.documentFullPath(self.document_name) logger.debug("going with full path of document: {0}".format(fullpath_doc_name)) persist_doc = PersistentScanningState(fullpath_doc_name) self.setField("secondScanComplete", persist_doc.info.merge_complete) self.wizard().setDocumentName(self.document_name) self.wizard().setWindowFilePath(fullpath_doc_name) return done
def initializePage(self): name_of_file = self.wizard().documentName() self.__refreshResultsUsingDocument( PersistentScanningState( DocumentStorage.documentFullPath(name_of_file))) self.wizard().removePage(WizardPage.CREATE_NEW) self.wizard().removePage(WizardPage.FIRST_SCAN_PROGRESS) self.wizard().removePage(WizardPage.SECOND_SCAN_PROGRESS) self.wizard().removePage(WizardPage.SCANNING_COMPLETE_INSTALL_NOW) self.wizard().reinsertCreateScanPage()
def isComplete(self): done = self.document_name is not None if done: # if the second scan completed OK, we can skip the second scan fullpath_doc_name = DocumentStorage.documentFullPath( self.document_name) logger.debug("going with full path of document: {0}".format( fullpath_doc_name)) persist_doc = PersistentScanningState(fullpath_doc_name) self.setField("secondScanComplete", persist_doc.info.merge_complete) self.wizard().setDocumentName(self.document_name) self.wizard().setWindowFilePath(fullpath_doc_name) return done
def initializePage(self): """ Find and load the persistent document, create the export UI and insert it into the 'container'. This method assumes that the wizard has a documentName set. """ self.container = QWidget(self) if self.plugin is not None: self.plugin.ui.setParent(None) self.gridLayout.removeWidget(self.plugin.ui) self.plugin.ui = None self.plugin = None name_of_file = self.wizard().documentName() document = PersistentScanningState(DocumentStorage.documentFullPath(name_of_file)) self.plugin = self.__createPluginNamed(self.field("exportType").toString()) ui = self.__createExportUI(document, self.container) self.gridLayout.addWidget(ui) self.changed()
def initializePage(self): """ Find and load the persistent document, create the export UI and insert it into the 'container'. This method assumes that the wizard has a documentName set. """ self.container = QWidget(self) if self.plugin is not None: self.plugin.ui.setParent(None) self.gridLayout.removeWidget(self.plugin.ui) self.plugin.ui = None self.plugin = None name_of_file = self.wizard().documentName() document = PersistentScanningState( DocumentStorage.documentFullPath(name_of_file)) self.plugin = self.__createPluginNamed( self.field("exportType").toString()) ui = self.__createExportUI(document, self.container) self.gridLayout.addWidget(ui) self.changed()