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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Julien Cabieces
otb
Commits
a46a040a
Commit
a46a040a
authored
10 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
strict checking of case on parameter keys
Signed-off-by:
Rashad Kanavath
<
rashad.kanavath@c-s.fr
>
parent
f3882147
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Wrappers/SWIG/src/otbApplication.i
+6
-8
6 additions, 8 deletions
Modules/Wrappers/SWIG/src/otbApplication.i
with
6 additions
and
8 deletions
Modules/Wrappers/SWIG/src/otbApplication.i
+
6
−
8
View file @
a46a040a
...
...
@@ -480,11 +480,10 @@ import keyword
parameters in the 'otb application' with instance App
"""
if attr is not None:
if attr
.lower() in self.GetParametersKeys(True)
:
key_list = [k.upper() for k in self.GetParametersKeys(True)]
if attr
in key_list
:
attr = attr.lower()
parameter_type = self.GetParameterType(attr)
if parameter_type in [ParameterType_InputProcessXML, ParameterType_Choice,
ParameterType_String, ParameterType_InputFilename,
ParameterType_OutputImage, ParameterType_OutputVectorData,
...
...
@@ -502,10 +501,8 @@ import keyword
return self.GetParameterFloat(attr)
elif parameter_type in [ParameterType_Empty]:
return self.IsParameterEnabled(attr)
else:
raise AttributeError
else:
pass
raise AttributeError
def __setattr__(self, attr, value):
"""
...
...
@@ -518,7 +515,8 @@ import keyword
list of existing parameters for application with 'self.GetParametersKeys(True)'
"""
if attr is not None:
if attr.lower() in self.GetParametersKeys(True):
key_list = [k.upper() for k in self.GetParametersKeys(True)]
if attr in key_list:
attr = attr.lower()
parameter_type = self.GetParameterType(attr)
if parameter_type in [ParameterType_InputProcessXML, ParameterType_Choice,
...
...
@@ -542,7 +540,7 @@ import keyword
# # not reaching here due to swig seeing self.__dict__ as yet another object
return dict.__setattr__(self, attr, value)
else:
raise AttributeError
raise AttributeError
}
}
...
...
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