mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
make advanced params optional to keep algorithm API stable
This commit is contained in:
parent
3d33b9f1e2
commit
c64383702e
@ -83,12 +83,14 @@ class gdaladdo(GdalAlgorithm):
|
||||
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 @@ class TestGdalAlgorithms(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
['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):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user