Skip to content

Commit

Permalink
Fix overridden function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 13, 2017
1 parent 5c888c5 commit ce8e18d
Show file tree
Hide file tree
Showing 49 changed files with 145 additions and 49 deletions.
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/AssignProjection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class AssignProjection(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterCrs(self.CRS,
self.tr('Desired CRS'), ''))
Expand All @@ -66,7 +68,7 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
fileName = self.getParameterValue(self.INPUT)
crs = self.getParameterValue(self.CRS)
output = self.getOutputValue(self.OUTPUT) # NOQA
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/ClipByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class ClipByExtent(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave blank to take the nodata value from input"),
Expand Down Expand Up @@ -83,7 +85,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
noData = self.getParameterValue(self.NO_DATA)
opts = self.getParameterValue(self.OPTIONS)
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/ClipByMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class ClipByMask(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterVector(self.MASK, self.tr('Mask layer'),
[dataobjects.TYPE_VECTOR_POLYGON]))
Expand Down Expand Up @@ -102,7 +104,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
mask = self.getParameterValue(self.MASK)
context = dataobjects.createContext()
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/ColorRelief.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class ColorRelief(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
Expand All @@ -70,7 +72,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['color-relief']
arguments.append(str(self.getParameterValue(self.INPUT)))
arguments.append(str(self.getParameterValue(self.COLOR_TABLE)))
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GdalAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def createInstance(self, config={}):
def createCustomParametersWidget(self, parent):
return GdalAlgorithmDialog(self)

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
return None

def processAlgorithm(self, parameters, context, feedback):
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/GridAverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class GridAverage(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
Expand Down Expand Up @@ -90,7 +92,7 @@ def icon(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/GridDataMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class GridDataMetrics(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
Expand Down Expand Up @@ -97,7 +99,7 @@ def icon(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/GridInvDist.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
Expand Down Expand Up @@ -100,7 +102,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/GridNearest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterVector(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POINT]))
self.addParameter(ParameterTableField(self.Z_FIELD,
Expand Down Expand Up @@ -88,7 +90,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['-l']
arguments.append(
os.path.basename(os.path.splitext(
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/aspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class aspect(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(
self.BAND, self.tr('Band number'), 1, 99, 1))
Expand All @@ -74,7 +76,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['aspect']
arguments.append(str(self.getParameterValue(self.INPUT)))
output = str(self.getOutputValue(self.OUTPUT))
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/buildvrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class buildvrt(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterSelection(self.RESOLUTION,
Expand All @@ -75,7 +77,7 @@ def icon(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-resolution')
arguments.append(self.RESOLUTION_OPTIONS[self.getParameterValue(self.RESOLUTION)])
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class contour(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT_RASTER,
self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.INTERVAL,
Expand All @@ -79,7 +81,7 @@ def icon(self):
def group(self):
return self.tr('Raster extraction')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
output = self.getOutputValue(self.OUTPUT_VECTOR)
interval = str(self.getParameterValue(self.INTERVAL))
fieldName = str(self.getParameterValue(self.FIELD_NAME))
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/extractprojection.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class ExtractProjection(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input file')))
self.addParameter(ParameterBoolean(self.PRJ_FILE,
self.tr('Create also .prj file'), False))
Expand All @@ -62,7 +64,7 @@ def icon(self):
def group(self):
return self.tr('Raster projections')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
return ["extractprojection"]

def processAlgorithm(self, parameters, context, feedback):
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/fillnodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class fillnodata(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.DISTANCE,
Expand All @@ -78,7 +80,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
output = self.getOutputValue(self.OUTPUT)

arguments = []
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/gdal2tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class gdal2tiles(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
# Required parameters
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))

Expand Down Expand Up @@ -128,7 +130,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):

arguments = []

Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/gdal2xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class gdal2xyz(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterNumber(self.BAND,
Expand All @@ -61,7 +63,7 @@ def displayName(self):
def group(self):
return self.tr('Raster conversion')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-band')
arguments.append(str(self.getParameterValue(self.BAND)))
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/gdaladdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterString(self.LEVELS,
Expand All @@ -89,7 +91,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
inFile = self.getParameterValue(self.INPUT)
clearOverviews = self.getParameterValue(self.CLEAN)
ovrFormat = self.getParameterValue(self.FORMAT)
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/gdalcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class gdalcalc(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(
self.INPUT_A, self.tr('Input layer A'), False))
self.addParameter(ParameterString(self.BAND_A,
Expand Down Expand Up @@ -106,7 +108,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
out = self.getOutputValue(self.OUTPUT)
extra = self.getParameterValue(self.EXTRA)
if extra is not None:
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/gdaltindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class gdaltindex(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'), dataobjects.TYPE_RASTER))
self.addParameter(ParameterString(self.FIELD_NAME,
Expand All @@ -71,7 +73,7 @@ def icon(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
fieldName = str(self.getParameterValue(self.FIELD_NAME))

arguments = []
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/hillshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class hillshade(GdalAlgorithm):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(self.INPUT, self.tr('Input layer')))
self.addParameter(ParameterNumber(self.BAND,
self.tr('Band number'), 1, 99, 1))
Expand Down Expand Up @@ -83,7 +85,7 @@ def displayName(self):
def group(self):
return self.tr('Raster analysis')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = ['hillshade']
arguments.append(str(self.getParameterValue(self.INPUT)))
arguments.append(str(self.getOutputValue(self.OUTPUT)))
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterRaster(information.INPUT,
self.tr('Input layer'), False))
self.addParameter(ParameterBoolean(information.NOGCP,
Expand All @@ -69,7 +71,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
if self.getParameterValue(information.NOGCP):
arguments.append('-nogcp')
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/gdal/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def icon(self):

def __init__(self):
super().__init__()

def initAlgorithm(self, config=None):
self.addParameter(ParameterMultipleInput(self.INPUT,
self.tr('Input layers'),
dataobjects.TYPE_RASTER))
Expand Down Expand Up @@ -87,7 +89,7 @@ def displayName(self):
def group(self):
return self.tr('Raster miscellaneous')

def getConsoleCommands(self, parameters):
def getConsoleCommands(self, parameters, context, feedback):
arguments = []
arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])
Expand Down
Loading

0 comments on commit ce8e18d

Please sign in to comment.