Skip to content

Commit ccbca66

Browse files
committedMar 22, 2017
code cleanups
1 parent acd3744 commit ccbca66

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
 

‎python/plugins/processing/tools/general.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,15 @@ def alglist(text=None):
5555
def algorithmOptions(name):
5656
alg = Processing.getAlgorithm(name)
5757
if alg is not None:
58-
s = ''
58+
opts = ''
5959
for param in alg.parameters:
6060
if isinstance(param, ParameterSelection):
61-
s += param.name + '(' + param.description + ')\n'
62-
i = 0
63-
for option in param.options:
64-
s += '\t' + str(i) + ' - ' + str(option) + '\n'
65-
i += 1
66-
print(s)
61+
opts += '{} ({})\n'.format(param.name, param.description)
62+
for option in enumerate(param.options):
63+
opts += '\t{} - {}\n'.format(option[0], option[1])
64+
print(opts)
6765
else:
68-
print('Algorithm not found')
66+
print('Algorithm "{}" not found.'.format(name))
6967

7068

7169
def algorithmHelp(name):
@@ -75,7 +73,7 @@ def algorithmHelp(name):
7573
print(str(alg))
7674
algorithmOptions(name)
7775
else:
78-
print('Algorithm not found')
76+
print('Algorithm "{}" not found.'.format(name))
7977

8078

8179
def runalg(algOrName, *args, **kwargs):

0 commit comments

Comments
 (0)
Please sign in to comment.