mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
code cleanups
This commit is contained in:
parent
acd37449f3
commit
ccbca66492
@ -55,17 +55,15 @@ def alglist(text=None):
|
|||||||
def algorithmOptions(name):
|
def algorithmOptions(name):
|
||||||
alg = Processing.getAlgorithm(name)
|
alg = Processing.getAlgorithm(name)
|
||||||
if alg is not None:
|
if alg is not None:
|
||||||
s = ''
|
opts = ''
|
||||||
for param in alg.parameters:
|
for param in alg.parameters:
|
||||||
if isinstance(param, ParameterSelection):
|
if isinstance(param, ParameterSelection):
|
||||||
s += param.name + '(' + param.description + ')\n'
|
opts += '{} ({})\n'.format(param.name, param.description)
|
||||||
i = 0
|
for option in enumerate(param.options):
|
||||||
for option in param.options:
|
opts += '\t{} - {}\n'.format(option[0], option[1])
|
||||||
s += '\t' + str(i) + ' - ' + str(option) + '\n'
|
print(opts)
|
||||||
i += 1
|
|
||||||
print(s)
|
|
||||||
else:
|
else:
|
||||||
print('Algorithm not found')
|
print('Algorithm "{}" not found.'.format(name))
|
||||||
|
|
||||||
|
|
||||||
def algorithmHelp(name):
|
def algorithmHelp(name):
|
||||||
@ -75,7 +73,7 @@ def algorithmHelp(name):
|
|||||||
print(str(alg))
|
print(str(alg))
|
||||||
algorithmOptions(name)
|
algorithmOptions(name)
|
||||||
else:
|
else:
|
||||||
print('Algorithm not found')
|
print('Algorithm "{}" not found.'.format(name))
|
||||||
|
|
||||||
|
|
||||||
def runalg(algOrName, *args, **kwargs):
|
def runalg(algOrName, *args, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user