Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
2ba8647b
Commit
2ba8647b
authored
6 years ago
by
Victor Poughon
Browse files
Options
Downloads
Patches
Plain Diff
DOC: fix string list display formatting
parent
db8fedab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!621
Release 7.0 (master)
,
!316
Christmas CookBook
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+8
-2
8 additions, 2 deletions
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+9
-3
9 additions, 3 deletions
.../Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
with
17 additions
and
5 deletions
Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py
+
8
−
2
View file @
2ba8647b
...
...
@@ -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
""
...
...
This diff is collapsed.
Click to expand it.
Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+
9
−
3
View file @
2ba8647b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment