aggiunta costruzione della configurazione per splitter
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
"dateFormat": "{month} {day:d}, {year:d}{}",
|
"dateFormat": "{month} {day:d}, {year:d}{}",
|
||||||
"outPrefix": "111",
|
"outPrefix": "111",
|
||||||
"outSuffix": "222",
|
"outSuffix": "222",
|
||||||
|
"outExt": ".txt",
|
||||||
"outDateType": "jpn",
|
"outDateType": "jpn",
|
||||||
"outNameFormat": "",
|
"outNameFormat": "",
|
||||||
"outDate": true,
|
"outDate": true,
|
||||||
|
|||||||
@@ -416,6 +416,27 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget):
|
|||||||
|
|
||||||
def splitta(self):
|
def splitta(self):
|
||||||
# costruisco il dizionario di configurazione
|
# 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
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class bananaCONF(object):
|
|||||||
|
|
||||||
def use(self, toUse):
|
def use(self, toUse):
|
||||||
self.inUse = toUse
|
self.inUse = toUse
|
||||||
pass
|
return self
|
||||||
|
|
||||||
def save(self, fName=None):
|
def save(self, fName=None):
|
||||||
if fName is None:
|
if fName is None:
|
||||||
@@ -96,6 +96,9 @@ class bananaCONF(object):
|
|||||||
self.log.error("Parametro di configurazione non valido! [{}]".format(ve))
|
self.log.error("Parametro di configurazione non valido! [{}]".format(ve))
|
||||||
return False
|
return False
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def dump(self):
|
||||||
|
return self.settingsList[self.inUse]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user