selezione della versione del file, filtraggio tipo per txt
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"docStruct": {
|
"docStruct": {
|
||||||
|
"fileVersNew": true,
|
||||||
"language": "English",
|
"language": "English",
|
||||||
"docSep": "\\s*Copyright [(0-9)]+",
|
"docSep": "\\s*Copyright [(0-9)]+",
|
||||||
"beginOfDocument":"\\s*Body",
|
"beginOfDocument":"\\s*Body",
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
|||||||
try:
|
try:
|
||||||
self.ui.lbl_sorg.setText(self.conf.getParam('paths','INworkPath'))
|
self.ui.lbl_sorg.setText(self.conf.getParam('paths','INworkPath'))
|
||||||
self.ui.lbl_dest.setText(self.conf.getParam('paths','OUTworkPath'))
|
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()
|
self.fillFileList()
|
||||||
except:
|
except:
|
||||||
self.log.critical("MainWindow: Configurazione non accettata")
|
self.log.critical("MainWindow: Configurazione non accettata")
|
||||||
@@ -88,7 +90,9 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
|||||||
self.advopt.fillInterface()
|
self.advopt.fillInterface()
|
||||||
|
|
||||||
def fillFileList(self):
|
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()
|
self.ui.lst_files.clear()
|
||||||
for f in fl:
|
for f in fl:
|
||||||
self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f))
|
self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f))
|
||||||
|
|||||||
@@ -43,7 +43,10 @@ class bananaSPLITTER(QRunnable):
|
|||||||
try:
|
try:
|
||||||
self.openFile()
|
self.openFile()
|
||||||
self.remEmptyLines()
|
self.remEmptyLines()
|
||||||
self.splitFile()
|
if self.docStruct['fileVersNew']:
|
||||||
|
self.newSplitFile()
|
||||||
|
else:
|
||||||
|
self.splitFile()
|
||||||
|
|
||||||
if self.settings['removeDuplicates']:
|
if self.settings['removeDuplicates']:
|
||||||
self.log.info("Controllo se ci sono dei duplicati..")
|
self.log.info("Controllo se ci sono dei duplicati..")
|
||||||
@@ -165,7 +168,6 @@ class bananaSPLITTER(QRunnable):
|
|||||||
else:
|
else:
|
||||||
newsPaperName = self.settings['nameNotFoundStr']
|
newsPaperName = self.settings['nameNotFoundStr']
|
||||||
newsName = False
|
newsName = False
|
||||||
|
|
||||||
except IndexError:
|
except IndexError:
|
||||||
self.log.error("Errore inaspettato, contatta il tuo sviluppatore di fiducia!")
|
self.log.error("Errore inaspettato, contatta il tuo sviluppatore di fiducia!")
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user