Skip to content
Browse files
[processing] multiple band selection wrapper should return list of ints
  • Loading branch information
nirvn committed Sep 4, 2018
1 parent 1664ef1 commit 97adef21bdbfc7aefc30a1d723ed5d1725515339
@@ -119,10 +119,7 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):

bands = self.parameterAsFields(parameters, self.BANDS, context)
for band in bands:
match ='(?:\A|[^0-9])([0-9]+)(?:\Z|[^0-9]|)', band)
if match:
band_nb =
arguments.append('-b {}'.format(band_nb))
arguments.append('-b {}'.format(band))

arguments.append(self.TYPES[self.parameterAsEnum(parameters, self.DATA_TYPE, context)])
@@ -28,6 +28,7 @@

import locale
import os
import re
from functools import cmp_to_key
from inspect import isclass
from copy import deepcopy
@@ -1726,10 +1727,8 @@ def setValue(self, value):

for v in value:
for i, opt in enumerate(options):
if opt == v:
# case insensitive check - only do if matching case value is not present
elif v not in options and opt.lower() == v.lower():
match ='(?:\A|[^0-9]){}(?:\Z|[^0-9]|)'.format(v), opt)
if match:

@@ -1741,7 +1740,12 @@ def setValue(self, value):
def value(self):
if self.dialogType in (DIALOG_STANDARD, DIALOG_BATCH):
if self.param.allowMultiple():
return [self.widget.options[i] for i in self.widget.selectedoptions]
bands = []
for i in self.widget.selectedoptions:
match ='(?:\A|[^0-9])([0-9]+)(?:\Z|[^0-9]|)', self.widget.options[i])
if match:
return bands
f = self.widget.currentBand()
if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional and not f:

0 comments on commit 97adef2

Please sign in to comment.