Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KADMOS
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LR-FPP-MDO
KADMOS
Commits
8b75c824
Commit
8b75c824
authored
6 years ago
by
imcovangent
Browse files
Options
Downloads
Patches
Plain Diff
Added function to add valid range in CMDOWS file.
Former-commit-id: 45d113be421c78e90c472adced599b9225478250
parent
46345631
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kadmos/cmdows/cmdows.py
+29
-1
29 additions, 1 deletion
kadmos/cmdows/cmdows.py
with
29 additions
and
1 deletion
kadmos/cmdows/cmdows.py
+
29
−
1
View file @
8b75c824
...
@@ -388,7 +388,7 @@ class CMDOWS(object):
...
@@ -388,7 +388,7 @@ class CMDOWS(object):
:param description: description of file content
:param description: description of file content
:type description: str
:type description: str
:param timestamp: (optional) date and time of creation
:param timestamp: (optional) date and time of creation
:type timestamp:
datetime
:type timestamp:
str
:param fileVersion: version of the file
:param fileVersion: version of the file
:type fileVersion: str
:type fileVersion: str
:param cmdowsVersion: version of the xsd schema
:param cmdowsVersion: version of the xsd schema
...
@@ -922,6 +922,34 @@ class CMDOWS(object):
...
@@ -922,6 +922,34 @@ class CMDOWS(object):
self
.
add_subelement
(
el_pr
[
0
],
eltag
)
self
.
add_subelement
(
el_pr
[
0
],
eltag
)
return
self
.
root
.
xpath
(
local_xpath
)[
0
]
return
self
.
root
.
xpath
(
local_xpath
)[
0
]
def
add_valid_ranges
(
self
,
elem_or_uid
,
minimum
=
None
,
maximum
=
None
,
list_range
=
None
):
"""
Method to add the list ranges element to an existing element.
:param elem_or_uid: element or the UID of an element
:type elem_or_uid: str or ExtendedElement
:param minimum: minimum value for valid range
:type minimum: float
:param maximum: maximum value for valid range
:type maximum: float
:param list_range: list of optional values
:type list_range: list
"""
if
isinstance
(
elem_or_uid
,
str
):
elem
=
self
.
get_element_of_uid
(
elem_or_uid
)
else
:
elem
=
elem_or_uid
vr_elem
=
elem
.
add
(
'
validRanges
'
)
if
minimum
is
not
None
or
maximum
is
not
None
:
lr_elem
=
vr_elem
.
add
(
'
limitRange
'
)
if
minimum
is
not
None
:
lr_elem
.
add
(
'
minimum
'
,
float
(
minimum
))
if
maximum
is
not
None
:
lr_elem
.
add
(
'
maximum
'
,
float
(
maximum
))
if
list_range
is
not
None
:
list_range_elem
=
vr_elem
.
add
(
'
listRange
'
)
for
item
in
list_range
:
list_range_elem
.
add
(
'
listRangeItem
'
,
str
(
item
))
def
append_element_to_xpath_element
(
self
,
xpath
,
element_tag
,
attrib
=
None
):
def
append_element_to_xpath_element
(
self
,
xpath
,
element_tag
,
attrib
=
None
):
"""
Method to append a new element at an XPath location.
"""
Method to append a new element at an XPath location.
...
...
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