From 8a9ce0dc9f7e4f3457cfcbe755ee3248baa938eb Mon Sep 17 00:00:00 2001 From: Emanuele Date: Mon, 12 Oct 2020 16:03:47 +0200 Subject: [PATCH] eliminati pass inutili --- SPEx/spex/guimain.py | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/SPEx/spex/guimain.py b/SPEx/spex/guimain.py index 2d4e900..c108117 100644 --- a/SPEx/spex/guimain.py +++ b/SPEx/spex/guimain.py @@ -71,7 +71,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.setFixedSize(QSize(self.conf.getParam( 'settings', 'winW'), self.conf.getParam('settings', 'winH'))) - pass + def fillInterface(self): #pagina principale try: @@ -85,12 +85,14 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.fillFileList() except: self.log.critical(self.tr("MainWindow: Configurazione non accettata")) + def fillAllInterfaces(self): self.fillInterface() self.titolo.fillInterface() self.titoloav.fillInterface() self.selezout.fillInterface() self.advopt.fillInterface() + def fillFileList(self): fl = QDir(self.conf.getParam('paths', 'INworkPath')) fl.setNameFilters(['*.txt', '*.TXT']) @@ -99,14 +101,15 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): for f in fl: self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f)) self.conf.setParam(('paths', 'fileList'), fl) + def nextTab(self): self.ui.wgt_main.setCurrentIndex(self.ui.wgt_main.currentIndex()+1) self.logger.debug(self.tr("Prossima Tab")) - pass + def prevTab(self): self.ui.wgt_main.setCurrentIndex(self.ui.wgt_main.currentIndex()-1) self.logger.debug(self.tr("Tab Precedente")) - pass + def openLoadPreset(self): self.logger.debug(self.tr("Apri Carica Preset")) lf = PyQt5.QtWidgets.QFileDialog(self, self.tr( @@ -121,7 +124,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.conf.use(cf) self.logger.debug(self.tr("Riempio tutte le tab")) self.fillAllInterfaces() - pass + def openSavePreset(self): self.logger.debug(self.tr("Apri Salva Preset")) self.applicaTutto() @@ -141,12 +144,12 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): ## self.logger.debug(self.tr(f"Scrivo la configurazione: {rv}")) self.conf.save(fName=rv) - pass + def openAdvOpt(self): self.logger.debug(self.tr("Apri Opzioni Avanzate")) self.advopt.fillInterface() self.advopt.show() - pass + def openLanguage(self): global langlist self.logger.debug(self.tr("Apri Opzioni Lingua")) @@ -171,7 +174,6 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.logger.info( self.tr("Selezionata Cartella Sorgente: {}").format(rv+"/")) self.fillFileList() - pass def selezDest(self): rv = PyQt5.QtWidgets.QFileDialog.getExistingDirectory(self, self.tr( @@ -181,7 +183,6 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.ui.lbl_dest.setText(rv) self.logger.info( self.tr("Selezionata Cartella Destinazione: {}").format(rv+"/")) - pass def selezVers(self): self.conf.setParam(('docStruct', 'fileVersNew'), @@ -216,7 +217,6 @@ class bananaTitolo(PyQt5.QtWidgets.QWidget): self.titoloui.btn_avanti.clicked.connect(self.applica) self.advtitolo = bananaTitoloAvanzate(confloader, self.log) self.fillInterface() - pass def fillInterface(self): try: @@ -258,7 +258,6 @@ class bananaTitolo(PyQt5.QtWidgets.QWidget): def spawnAvanzate(self): self.log.debug(self.tr("Mostro la finestra avanzate titolo")) self.advtitolo.show() - pass def applica(self): self.log.info(self.tr("Applico impostazioni Titolo")) @@ -284,7 +283,6 @@ class bananaTitolo(PyQt5.QtWidgets.QWidget): if len(itm.text()) == 1 and itm.isChecked(): self.conf.setParam(('docStruct', 'outNameSep'), itm.text()) self.advtitolo.applica() - pass class bananaTitoloAvanzate(PyQt5.QtWidgets.QWidget): @@ -307,7 +305,6 @@ class bananaTitoloAvanzate(PyQt5.QtWidgets.QWidget): self.conf = confloader self.log = logger self.fillInterface() - pass def fillInterface(self): try: @@ -386,18 +383,15 @@ class bananaTitoloAvanzate(PyQt5.QtWidgets.QWidget): self.titoloavui.rad_dataterzo.setChecked(False) self.titoloavui.rad_titoloprimo.setChecked(False) self.titoloavui.rad_titolosecondo.setChecked(False) - pass def returnOk(self): self.log.info(self.tr("Avanzate Titolo Accettate")) self.applica() self.hide() - pass def returnKo(self): self.log.info(self.tr("Avanzate Titolo Rifiutate")) self.hide() - pass def applica(self): #data @@ -445,7 +439,6 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget): self.selezoutui.btn_split.clicked.connect(self.applica) self.selezoutui.btn_split.clicked.connect(self.splitta) self.fillInterface() - pass def fillInterface(self): try: @@ -470,10 +463,8 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget): self.conf.getParam('settings', 'removeOldFiles')) self.selezoutui.lin_specialChars.setText( ''.join(self.conf.getParam('settings', 'delChars'))) - pass except: self.log.critical(self.tr("SelezUscita: Configurazione non accettata")) - pass def applica(self): self.log.info(self.tr("Applico Impostazioni File Uscita")) @@ -495,7 +486,6 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget): self.selezoutui.chk_cleaDestFolder.isChecked()) self.conf.setParam(('settings', 'delChars'), list( self.selezoutui.lin_specialChars.text())) - pass def splitta(self): # costruisco il dizionario di configurazione @@ -550,7 +540,6 @@ class bananaSelezOut(PyQt5.QtWidgets.QWidget): self.log.error(self.tr(f"Impossibile avviare lo splitter: {e}")) msgb.setText(self.tr("FINITO!")) - pass class bananaAdvOpt(PyQt5.QtWidgets.QWidget): @@ -568,7 +557,6 @@ class bananaAdvOpt(PyQt5.QtWidgets.QWidget): self.advoptui.btn_ok.clicked.connect(self.accetta) self.advoptui.btn_cancel.clicked.connect(self.rifiuta) self.fillInterface() - pass def fillInterface(self): try: @@ -576,7 +564,6 @@ class bananaAdvOpt(PyQt5.QtWidgets.QWidget): json.dumps(self.conf.dump(), indent=2)) except: self.log.critical(self.tr("AdvancedOptions: Configurazione non accettata")) - pass def accetta(self): self.errmsg = QMessageBox() @@ -601,12 +588,10 @@ class bananaAdvOpt(PyQt5.QtWidgets.QWidget): self.errmsg.setIcon(QMessageBox.Critical) self.errmsg.setText(self.tr(f"Errore nei parametri!\n{e}")) self.errmsg.show() - pass def rifiuta(self): self.log.info(f"AdvancedOptions: Configurazione Rifiutata") self.hide() - pass class bananaSplitterInterface(PyQt5.QtWidgets.QWidget): @@ -623,7 +608,6 @@ class spexAbout(PyQt5.QtWidgets.QDialog): self.abt.lbl_info.setText(self.abt.lbl_info.text().replace( '{ver}', confloader.getParam('version'))) self.show() - pass ############################################################# ####################### MAIN ################################ ############################################################# @@ -674,4 +658,3 @@ if __name__ == '__main__': rv = app.exec() print("ExitCode: {}".format(rv)) sys.exit(rv) - pass