selezione della versione del file, filtraggio tipo per txt

This commit is contained in:
2020-03-30 13:16:56 +02:00
parent 83f3a1f629
commit 5725c14b83
3 changed files with 10 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
]
},
"docStruct": {
"fileVersNew": true,
"language": "English",
"docSep": "\\s*Copyright [(0-9)]+",
"beginOfDocument":"\\s*Body",

View File

@@ -76,6 +76,8 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
try:
self.ui.lbl_sorg.setText(self.conf.getParam('paths','INworkPath'))
self.ui.lbl_dest.setText(self.conf.getParam('paths','OUTworkPath'))
self.ui.rad_fileNew.setChecked(self.conf.getParam('docStruct', 'fileVersNew'))
self.ui.rad_fileOld.setChecked(not self.conf.getParam('docStruct', 'fileVersNew'))
self.fillFileList()
except:
self.log.critical("MainWindow: Configurazione non accettata")
@@ -88,7 +90,9 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
self.advopt.fillInterface()
def fillFileList(self):
fl = QDir(self.conf.getParam('paths','INworkPath')).entryList(QDir.NoDotAndDotDot | QDir.Files)
fl = QDir(self.conf.getParam('paths','INworkPath'))
fl.setNameFilters(['*.txt','*.TXT'])
fl.entryList(QDir.NoDotAndDotDot | QDir.Files)
self.ui.lst_files.clear()
for f in fl:
self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f))

View File

@@ -43,7 +43,10 @@ class bananaSPLITTER(QRunnable):
try:
self.openFile()
self.remEmptyLines()
self.splitFile()
if self.docStruct['fileVersNew']:
self.newSplitFile()
else:
self.splitFile()
if self.settings['removeDuplicates']:
self.log.info("Controllo se ci sono dei duplicati..")
@@ -165,7 +168,6 @@ class bananaSPLITTER(QRunnable):
else:
newsPaperName = self.settings['nameNotFoundStr']
newsName = False
except IndexError:
self.log.error("Errore inaspettato, contatta il tuo sviluppatore di fiducia!")
pass