mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 12:28:44 +00:00
utils/doc: Change get_params_rst to be more flexible
Instead of taking an extension as a parameter and assuming there it has an attribute 'parameters' instead take a list of parameters directly which allows the method to be used with parameter lists with different names.
This commit is contained in:
parent
6df498b4bd
commit
adb14442c8
@ -267,9 +267,9 @@ def format_literal(lit):
|
|||||||
return '``{}``'.format(lit)
|
return '``{}``'.format(lit)
|
||||||
|
|
||||||
|
|
||||||
def get_params_rst(ext):
|
def get_params_rst(parameters):
|
||||||
text = ''
|
text = ''
|
||||||
for param in ext.parameters:
|
for param in parameters:
|
||||||
text += '{} : {} {}\n'.format(param.name, get_type_name(param.kind),
|
text += '{} : {} {}\n'.format(param.name, get_type_name(param.kind),
|
||||||
param.mandatory and '(mandatory)' or ' ')
|
param.mandatory and '(mandatory)' or ' ')
|
||||||
desc = strip_inlined_text(param.description or '')
|
desc = strip_inlined_text(param.description or '')
|
||||||
@ -300,7 +300,7 @@ def get_rst_from_extension(ext):
|
|||||||
else:
|
else:
|
||||||
desc = ''
|
desc = ''
|
||||||
text += desc + '\n\n'
|
text += desc + '\n\n'
|
||||||
params_rst = get_params_rst(ext)
|
params_rst = get_params_rst(ext.parameters)
|
||||||
if params_rst:
|
if params_rst:
|
||||||
text += underline('parameters', '~') + params_rst
|
text += underline('parameters', '~') + params_rst
|
||||||
return text + '\n'
|
return text + '\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user