Commit 2ba8647b authored by Victor Poughon's avatar Victor Poughon

DOC: fix string list display formatting

parent db8fedab
......@@ -228,10 +228,16 @@ def rst_parameter_value(app, key):
raise ValueError("Cannot show parameter value for type ", type)
def rst_parameter_flags(app, key):
"""
Display the mandatory and default value flags of a parameter
The display logic tries to follow the logic in WrapperCommandLineLauncher::DisplayParameterHelp
The default value is formatted using GetParameterAsString to use the same formatting as the cli interface
"""
if app.IsMandatory(key) and not app.HasValue(key):
return "*Mandatory* "
elif app.HasValue(key) and app.GetParameterType(key) != ParameterType_Group:
return "*Default value: {}* ".format(app.GetParameterAsString(key)) # get value as string to use the same formatting as the c++ api
elif app.HasValue(key) and app.GetParameterType(key) != ParameterType_Group and app.GetParameterAsString(key) != "":
return "*Default value: {}* ".format(app.GetParameterAsString(key))
else:
return ""
......
......@@ -1995,9 +1995,15 @@ std::string Application::GetParameterAsString(std::string paramKey)
{
std::ostringstream oss;
oss << std::setprecision(10);
const std::vector<std::string> strList = this->GetParameterStringList( paramKey );
for (unsigned int i=0; i<strList.size(); i++)
oss << strList[i] << std::endl;
const std::vector<std::string> strList = this->GetParameterStringList(paramKey);
for (size_t i = 0; i < strList.size(); i++)
{
if (i != 0)
{
oss << " ";
}
oss << strList[i];
}
ret = oss.str();
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment