Skip to content
Permalink
Browse files

make advanced params optional to keep algorithm API stable

(cherry picked from commit c643837)
  • Loading branch information
alexbruy committed Jan 1, 2019
1 parent be60f12 commit cee8a205fd70b953d5e769f3f00915900505e277
@@ -83,12 +83,14 @@ def initAlgorithm(self, config=None):
self.tr('Resampling method'),
options=[i[0] for i in self.methods],
allowMultiple=False,
defaultValue=0))
defaultValue=0,
optional=True))
params.append(QgsProcessingParameterEnum(self.FORMAT,
self.tr('Overviews format'),
options=self.formats,
allowMultiple=False,
defaultValue=0))
defaultValue=0,
optional=True))
for p in params:
p.setFlags(p.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(p)
@@ -2440,6 +2440,14 @@ def testGdalAddo(self):
['gdaladdo',
source + ' ' + '-r nearest 2 4 8 16 32 64'])

# without advanced params
self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'LEVELS': '2 4 8 16',
'CLEAN': False}, context, feedback),
['gdaladdo',
source + ' ' + '-r nearest 2 4 8 16'])


class TestGdalOgrToPostGis(unittest.TestCase):

0 comments on commit cee8a20

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