From 705a6ce85c44fef31394878b8713a5507d1a172b Mon Sep 17 00:00:00 2001 From: Emanuele Date: Wed, 18 Dec 2019 19:43:46 +0100 Subject: [PATCH] seguono modifiche al main per test parametri nuovo file di configurazione --- bananaSPLIT/guimain.py | 4 +- bananaSPLIT/libbananasplit/libconfload.py | 2 +- bananaSPLIT/libbananasplit/testEN.json | 145 +++++++++++----------- 3 files changed, 74 insertions(+), 77 deletions(-) diff --git a/bananaSPLIT/guimain.py b/bananaSPLIT/guimain.py index 578bfea..97b88f1 100644 --- a/bananaSPLIT/guimain.py +++ b/bananaSPLIT/guimain.py @@ -71,12 +71,12 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): def openLoadPreset(self): self.logger.debug("Apri Carica Preset") - self.logger.debug(str(self.conf.getParam('splitter','paths'))) + self.logger.debug(str(self.conf.getParam('paths'))) pass def openSavePreset(self): self.logger.debug("Apri Salva Preset") - self.logger.debug(str(self.conf.setParam("pippo", 'splitter','paths', 'INworkPath'))) + self.logger.debug(str(self.conf.setParam("pippo",'paths', 'INworkPath'))) pass def openAdvOpt(self): diff --git a/bananaSPLIT/libbananasplit/libconfload.py b/bananaSPLIT/libbananasplit/libconfload.py index fb27884..8484e6f 100644 --- a/bananaSPLIT/libbananasplit/libconfload.py +++ b/bananaSPLIT/libbananasplit/libconfload.py @@ -82,7 +82,7 @@ class bananaCONF(object): def setParam(self, val, *keys): sv = self.settingsList[self.inUse] for k in keys: - sv = sv[k] + sv = *sv[k] sv = val pass diff --git a/bananaSPLIT/libbananasplit/testEN.json b/bananaSPLIT/libbananasplit/testEN.json index f7e68d5..4f75010 100644 --- a/bananaSPLIT/libbananasplit/testEN.json +++ b/bananaSPLIT/libbananasplit/testEN.json @@ -1,78 +1,75 @@ { "version": "v1.1a", - "splitter": { - "name": "", - "paths": { - "INworkPath": "D:\\Emanuele\\Documenti\\workspace\\bananaSPLIT\\TestFiles\\", - "OUTworkPath": "H:\\", - "OUTnameFormat": "TEST_{docnum}_{year:04d}{month:02d}{day:02d}_{title}.txt" - }, - "docStruct": { - "docSep": "\\s*Copyright [(0-9)]+", - "dateFormat": "{month} {day:d}, {year:d}{}", - "dateWords": [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" - ], - "headWords": [ - "BYLINE:", - "SECTION:", - "LENGTH:", - "DATELINE:", - "HIGHLIGHT:", - "Email:" - ], - "tailWords": [ - "Newstex ID:", - "NOTES:", - "LANGUAGE:", - "GRAPHIC:", - "TYPE:", - "URL:", - "LOAD-DATE:", - "PUBLICATION-TYPE:", - "DOCUMENT-TYPE:", - "CHARTS:", - "JOURNAL-CODE:" - ] - }, - "settings": { - "encoding": "utf-8", - "monthPosition": 0, - "getNewsPaperName": true, - "nameNotFoundStr": "ND", - "includeTitle": true, - "removeDuplicates": true, - "showSkipped": true, - "showRemovedDuplicates": false, - "maxTitleLen": 32, - "loadTXT": true, - "loadDOCX": false, - "removeOldFiles": true, - "saveSeparateFiles": true, - "saveBodyFile": true, - "saveBodyNumber": true, - "delLF": false, - "delWordBreak": true, - "delChars": [ - "'", - "@", - "#", - "$", - "%", - "^", - "&" - ] - } + "paths": { + "INworkPath": "D:\\Emanuele\\Documenti\\workspace\\bananaSPLIT\\TestFiles\\", + "OUTworkPath": "H:\\", + "OUTnameFormat": "TEST_{docnum}_{year:04d}{month:02d}{day:02d}_{title}.txt" + }, + "docStruct": { + "docSep": "\\s*Copyright [(0-9)]+", + "dateFormat": "{month} {day:d}, {year:d}{}", + "dateWords": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + "headWords": [ + "BYLINE:", + "SECTION:", + "LENGTH:", + "DATELINE:", + "HIGHLIGHT:", + "Email:" + ], + "tailWords": [ + "Newstex ID:", + "NOTES:", + "LANGUAGE:", + "GRAPHIC:", + "TYPE:", + "URL:", + "LOAD-DATE:", + "PUBLICATION-TYPE:", + "DOCUMENT-TYPE:", + "CHARTS:", + "JOURNAL-CODE:" + ] + }, + "settings": { + "encoding": "utf-8", + "monthPosition": 0, + "getNewsPaperName": true, + "nameNotFoundStr": "ND", + "includeTitle": true, + "removeDuplicates": true, + "showSkipped": true, + "showRemovedDuplicates": false, + "maxTitleLen": 32, + "loadTXT": true, + "loadDOCX": false, + "removeOldFiles": true, + "saveSeparateFiles": true, + "saveBodyFile": true, + "saveBodyNumber": true, + "delLF": false, + "delWordBreak": true, + "delChars": [ + "'", + "@", + "#", + "$", + "%", + "^", + "&" + ] } }