Commit a4cd5a7b authored by PIERSON Julie's avatar PIERSON Julie
Browse files

cleaning unused code and import

parent 9dba9ffe
......@@ -33,7 +33,6 @@ from qgis.PyQt.QtWidgets import (QTreeWidgetItem,
from qgis.core import (QgsApplication,
QgsProject,
QgsMapLayer,
QgsRasterLayer,
QgsMapLayerProxyModel)
from processing.gui.wrappers import WidgetWrapper
from osgeo import gdal
......@@ -57,6 +56,9 @@ class BandTableWidget(BASE, WIDGET):
# when alg is launched by user, display bands in table of 1st raster layer
self.layerChanged()
# this is how to display a message for debugging
#QMessageBox.information(None, self.tr('window name'), self.tr('message'))
# when user changes selected layer in combobox
def layerChanged(self):
......@@ -66,7 +68,6 @@ class BandTableWidget(BASE, WIDGET):
layer = self.cmbLayers.currentLayer()
# if there is one
if layer != None:
#QMessageBox.information(None, self.tr('tralala'), self.tr(str(layer.name())))
input_raster = gdal.Open(layer.source())
# get number of bands in raster
nbands = input_raster.RasterCount
......@@ -143,7 +144,6 @@ class BandTableWidget(BASE, WIDGET):
if item:
row = [item.text(0), item.text(1), item.text(2)]
band_names.append(row)
#QMessageBox.information(None, self.tr('tralala'), self.tr(str(band_names)))
return band_names
def setLayer(self, layer):
......@@ -184,14 +184,11 @@ class BandTableWidget(BASE, WIDGET):
allValues += ';'
# adding input layer path to values
allValues += self.cmbLayers.currentLayer().source()
# allValues = [self.cmbLayers.currentLayer().source()]
# allValues += self.bandNames()
allValues += ';'
# adding table content to values
for b in self.bandNames():
allValues += '{0},{1},{2};'.format(b[0], b[1], b[2])
return allValues[:-1]
#return allValues
class BandTableWidgetWrapper(WidgetWrapper):
......
......@@ -31,9 +31,7 @@ __copyright__ = '(C) 2021 by J. Pierson, UMR 6554 LETG, CNRS'
__revision__ = '$Format:%H$'
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import (QgsProcessing,
QgsProcessingAlgorithm,
QgsRasterLayer,
from qgis.core import (QgsProcessingAlgorithm,
QgsProcessingParameterDefinition,
QgsProcessingParameterRasterDestination)
from osgeo import gdal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment