Skip to content
Snippets Groups Projects
Commit 2ba8647b authored by Victor Poughon's avatar Victor Poughon
Browse files

DOC: fix string list display formatting

parent db8fedab
No related branches found
No related tags found
2 merge requests!621Release 7.0 (master),!316Christmas CookBook
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment