prima versione funzionante con i file nuovi
corretto errore unicode, rimosso body dal contenuto del file, potrebbe rimanere il problema della chiave 'year'
This commit is contained in:
67
bananaSPLIT/conf/testbastardi.json
Normal file
67
bananaSPLIT/conf/testbastardi.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"version": "v1.1a",
|
||||
"paths": {
|
||||
"lastUsed": "testbastardi.json",
|
||||
"configurationPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/bananaSPLIT/conf/",
|
||||
"INworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles/FileBastardi",
|
||||
"OUTworkPath": "H:/",
|
||||
"fileList": [
|
||||
"Files(100)(1).txt",
|
||||
"Files(100)(2).txt"
|
||||
]
|
||||
},
|
||||
"docStruct": {
|
||||
"fileVersNew": true,
|
||||
"language": "English",
|
||||
"docSep": "\\s*Copyright [(0-9)]+",
|
||||
"beginOfDocument": "\\s*Body",
|
||||
"endOfDocument": "\\s*End of Document",
|
||||
"dateFormat": "{month} {day:d}, {year:d}{}",
|
||||
"outPrefix": "",
|
||||
"outSuffix": "",
|
||||
"outExt": ".txt",
|
||||
"outDateType": "jpn",
|
||||
"outNameFormat": "",
|
||||
"outDate": true,
|
||||
"outTitle": true,
|
||||
"outNumber": true,
|
||||
"numberPos": 3,
|
||||
"datePos": 1,
|
||||
"titlePos": 2,
|
||||
"maxTitleLen": 20,
|
||||
"outNameSep": "-",
|
||||
"customSep": "=",
|
||||
"dateFormats": {
|
||||
"jpn": "{year:04d}{month:02d}{day:02d}",
|
||||
"it": "{day:02d}{month:02d}{year:04d}",
|
||||
"usa": "{month:02d}{year:04d}{day:02d}"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"encoding": "ansi",
|
||||
"monthPosition": 0,
|
||||
"getNewsPaperName": true,
|
||||
"nameNotFoundStr": "ND",
|
||||
"includeTitle": false,
|
||||
"removeDuplicates": false,
|
||||
"showSkipped": false,
|
||||
"showRemovedDuplicates": false,
|
||||
"loadTXT": true,
|
||||
"loadDOCX": false,
|
||||
"removeOldFiles": true,
|
||||
"saveSeparateFiles": true,
|
||||
"saveBodyFile": true,
|
||||
"saveBodyNumber": true,
|
||||
"delLF": false,
|
||||
"delWordBreak": true,
|
||||
"delChars": [
|
||||
"'",
|
||||
"@",
|
||||
"#",
|
||||
"$",
|
||||
"%",
|
||||
"^",
|
||||
"&"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -167,6 +167,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
return
|
||||
|
||||
def applicaTutto(self):
|
||||
self.conf.setParam(('docStruct','fileVersNew'), self.ui.rad_fileNew.isChecked())
|
||||
self.titolo.applica()
|
||||
self.selezout.applica()
|
||||
self.advopt.applica()
|
||||
@@ -451,9 +452,9 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget):
|
||||
|
||||
@pyqtSlot()
|
||||
def updateState(msg):
|
||||
#print (msg)
|
||||
msgb.setText(msg)
|
||||
# costruisco i thread
|
||||
|
||||
tDict={}
|
||||
try:
|
||||
for f in splconf['paths']['fileList']:
|
||||
|
||||
@@ -179,9 +179,9 @@ class bananaSPLITTER(QObject):
|
||||
#doppio check per trovare l'inizio del corpo documento
|
||||
if re.match(self.docStruct['beginOfDocument'],l):
|
||||
self.status='body'
|
||||
if lineWords[0].upper() not in self.docStruct['language']['headWords']: #se la prima parola non e' tra quelle di inizio
|
||||
tempBody.append(l) # vuol dire che ho trovato l'articolo e aggiungo la prima riga al contenuto del documento
|
||||
self.status = 'body'
|
||||
#if lineWords[0].upper() not in self.docStruct['language']['headWords']: #se la prima parola non e' tra quelle di inizio
|
||||
#tempBody.append(l) # vuol dire che ho trovato l'articolo e aggiungo la prima riga al contenuto del documento
|
||||
#self.status = 'body'
|
||||
elif self.status == 'body':
|
||||
if re.match(self.docStruct['endOfDocument'],l) is not None: #controlla se ci sono articoli che non hanno le parole chiave finali
|
||||
self.log.warn("Ho individuato una separatore valido prima che si chiusesse l'articolo precedente, controlla i tuoi file in uscita!\n\
|
||||
|
||||
Reference in New Issue
Block a user