def processFolderData(self, path): """ processFolderData determines which processing method it's going to use: TIF/PDF/TIF+PDF & Recursive/Not-recursive""" filelist = [] fs = Filesorter([path]) if self.checkBox.isChecked(): if self.fileTypeComboBox.currentIndex() == 0: filelist.extend(fs.sorter("tif")) elif self.fileTypeComboBox.currentIndex() == 1: filelist.extend(fs.sorter("pdf")) else: filelist.extend(fs.sorter()) else: if self.fileTypeComboBox.currentIndex() == 0: for filename in os.listdir(path): if filename.lower().endswith(".tif"): filelist.append(os.path.join(path, filename)) elif self.fileTypeComboBox.currentIndex() == 1: for filename in os.listdir(path): if filename.lower().endswith(".pdf"): filelist.append(os.path.join(path, filename)) else: for filename in os.listdir(path): if filename.lower().endswith(".pdf") | filename.lower().endswith(".tif"): filelist.append(os.path.join(path, filename)) process = Process(filelist) process.processed.connect(self.update_filelist, Qt.QueuedConnection) process.run()
def dropEvent(self, e): file_path = [] for url in e.mimeData().urls(): file_path.append(unicode(url.toLocalFile())) fs = Filesorter(file_path) process = Process(fs.sorter()) process.processed.connect(self.update, Qt.QueuedConnection) process.run() self.file_save_path_signal.emit(unicode(os.path.dirname(file_path[0])))