aggiunta costruzione della configurazione per splitter

This commit is contained in:
2020-03-25 11:05:38 +01:00
parent b596f37cc3
commit 62f9dbe598
3 changed files with 26 additions and 1 deletions

View File

@@ -34,6 +34,7 @@
"dateFormat": "{month} {day:d}, {year:d}{}",
"outPrefix": "111",
"outSuffix": "222",
"outExt": ".txt",
"outDateType": "jpn",
"outNameFormat": "",
"outDate": true,

View File

@@ -416,6 +416,27 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget):
def splitta(self):
# costruisco il dizionario di configurazione
splconf = copy.deepcopy(self.conf.dump())
lang = copy.deepcopy(self.conf.use('languageconf.json').getParam(splconf['docStruct']['language']))
splconf['language'] = self.conf.use('languageconf.json').getParam(lang)
#formato nome in uscita
nametemp=[]
for i in range(3):
if i == splconf['docStruct']['numberPos'] and splconf['docStruct']['outNumber']:
nametemp.append("docnum")
if i == splconf['docStruct']['datePos'] and splconf['docStruct']['outDate']:
nametemp.append(splconf['docStruct']['dateFormats'][splconf['docStruct']['outDateType']])
if i == splconf['docStruct']['titlePos'] and splconf['docStruct']['outTitle']:
nametemp.append("title")
pass
if splconf['docStruct']['outPrefix'] != '':
nametemp.insert(0, splconf['docStruct']['outPrefix']) #inserisco prefisso e suffisso
if splconf['docStruct']['outSuffix'] != '':
nametemp.append(splconf['docStruct']['outSuffix'])
#unisco i pezzi
splconf['docStruct']['outNameFormat'] = splconf['docStruct']['outNameSep'].join(nametemp)+splconf['docStruct']['outExt']
pass

View File

@@ -55,7 +55,7 @@ class bananaCONF(object):
def use(self, toUse):
self.inUse = toUse
pass
return self
def save(self, fName=None):
if fName is None:
@@ -96,6 +96,9 @@ class bananaCONF(object):
self.log.error("Parametro di configurazione non valido! [{}]".format(ve))
return False
pass
def dump(self):
return self.settingsList[self.inUse]