def cleanupScan(self): if self.scanner is not None: self.scanner.stopScanning() if self.first_scan: DocumentStorage.deleteDocumentNamed(self.document_name) logger.debug("Scanner stopped and was reset") self.scanner = None
def __deleteSelectedItems(self): toDelete = self.deleteSelectedTreeViewItems(self.ui.treeView, "Remove Scan Files?", "Are you sure you want to delete the selected scan files - this action cannot be undone") for rowItems in toDelete: for item in rowItems: name = item.data(Qt.DisplayRole).toString() logger.debug("going to delete: {0}".format(name)) DocumentStorage.deleteDocumentNamed(name) self.scanFileDeleted.emit(name) break self.completeChanged.emit()
def __deleteSelectedItems(self): toDelete = self.deleteSelectedTreeViewItems( self.ui.treeView, "Remove Scan Files?", "Are you sure you want to delete the selected scan files - this action cannot be undone" ) for rowItems in toDelete: for item in rowItems: name = item.data(Qt.DisplayRole).toString() logger.debug("going to delete: {0}".format(name)) DocumentStorage.deleteDocumentNamed(name) self.scanFileDeleted.emit(name) break self.completeChanged.emit()
def test_scan_is_stored(self): t = DirectoryScanner() t.addPathsForScanning([good_app_path()]) # since its an iterable, force its execution for x in self.p.storeFilesystemSnapshot(t): pass # and the dir count contains something values = self.p.session.query(FileSystemSnapshot).all() self.assertTrue(len(values) > 0) self.assertTrue(DocumentStorage.deleteDocumentNamed('test.sqlite'))
def test_scan_is_stored(self): t = DirectoryScanner() t.addPathsForScanning([good_app_path()]) # since its an iterable, force its execution for x in self.p.storeFilesystemSnapshot(t): pass # and the dir count contains something values = self.p.session.query(FileSystemSnapshot).all() self.assertTrue(len(values) > 0) self.assertTrue(DocumentStorage.deleteDocumentNamed('test.sqlite'))