Skip to content
Permalink
Browse files

cleaned BatchProcessingDialog code

  • Loading branch information
volaya committed Nov 20, 2012
1 parent 8cb001d commit cb07ae436a4e0f7a66aebd1943758487184ca52b
@@ -5,7 +5,7 @@
PostGISExecuteSQL.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya, Carterix Geomatics
Copyright : (C) 2012 by Victor Olaya and Carterix Geomatics
Email : volayaf at gmail dot com
***************************************************************************
* *
@@ -31,7 +31,6 @@
from sextante.parameters.ParameterString import ParameterString
from sextante.admintools import postgis_utils
from sextante.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
import PyQt4

class PostGISExecuteSQL(GeoAlgorithm):

@@ -47,22 +47,19 @@
from sextante.parameters.ParameterFixedTable import ParameterFixedTable
from sextante.gui.FixedTablePanel import FixedTablePanel
from sextante.parameters.ParameterMultipleInput import ParameterMultipleInput
import copy
from sextante.gui.BatchOutputSelectionPanel import BatchOutputSelectionPanel
from sextante.gui.AlgorithmExecutor import AlgorithmExecutor
from sextante.outputs.OutputHTML import OutputHTML
from sextante.core.SextanteResults import SextanteResults
from sextante.core.SextanteLog import SextanteLog
from sextante.core.SextanteConfig import SextanteConfig
from sextante.gui.UnthreadedAlgorithmExecutor import SilentProgress,\
UnthreadedAlgorithmExecutor
from sextante.gui.UnthreadedAlgorithmExecutor import UnthreadedAlgorithmExecutor

class BatchProcessingDialog(AlgorithmExecutionDialog):
def __init__(self, alg):
self.algs = None
self.table = QtGui.QTableWidget(None)
AlgorithmExecutionDialog.__init__(self, alg, self.table)
#self.setModal(True)
AlgorithmExecutionDialog.__init__(self, alg, self.table)
self.setWindowModality(1)
self.algEx = None
self.resize(800, 500)
@@ -87,9 +84,7 @@ def __init__(self, alg):
self.setTableContent()
self.table.horizontalHeader().setStretchLastSection(True)
self.table.verticalHeader().setVisible(False)
self.table.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
#self.progress = QtGui.QProgressBar()
#self.progress.setMaximum(100)
self.table.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
self.addRowButton.clicked.connect(self.addRow)
self.deleteRowButton.clicked.connect(self.deleteRow)

@@ -137,11 +132,9 @@ def accept(self):
return
self.algs.append(alg)

QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
#self.progress.setMaximum(len(self.algs))
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.table.setEnabled(False)
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
#self.progress.setValue(0)
if SextanteConfig.getSetting(SextanteConfig.USE_THREADS):
self.nextAlg(0)
else:
i=1
@@ -209,9 +202,11 @@ def createSummaryTable(self):
outputFile = SextanteUtils.getTempFilename("html")
f = open(outputFile, "w")
for alg in self.algs:
f.write("<hr>\n")
for out in alg.outputs:
if isinstance(out, (OutputNumber,OutputString)):
f.write("<p>" + out.description + ": " + str(out.value) + "</p>\n")
f.write("<hr>\n")
f.close()
SextanteResults.addResult(self.algs[0].name + "[summary]", outputFile)

0 comments on commit cb07ae4

Please sign in to comment.
You can’t perform that action at this time.