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
da855925
Commit
da855925
authored
7 years ago
by
imcovangent
Browse files
Options
Downloads
Patches
Plain Diff
Minor updates in CMDOWS functions.
Former-commit-id: 8d7142d6415d628a3c5645b4588284c424553899
parent
b3dd8f02
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
+21
-5
21 additions, 5 deletions
kadmos/cmdows/cmdows.py
with
21 additions
and
5 deletions
kadmos/cmdows/cmdows.py
+
21
−
5
View file @
da855925
...
...
@@ -269,7 +269,7 @@ class CMDOWS(object):
# ----------------------------------------- #
# Add / change file functions #
# ----------------------------------------- #
def
add_header
(
self
,
creator
,
description
,
timestamp
=
None
,
fileVersion
=
"
0.0
"
):
def
add_header
(
self
,
creator
,
description
,
timestamp
=
None
,
fileVersion
=
"
0.0
"
,
cmdowsVersion
=
"
0.7
"
):
"""
Method to add a header to a CMDOWS file.
"""
# Assert header element exists
...
...
@@ -280,7 +280,7 @@ class CMDOWS(object):
el
.
add
(
"
description
"
,
description
)
el
.
add
(
"
timestamp
"
,
str
(
datetime
.
now
())
if
timestamp
is
None
else
timestamp
)
el
.
add
(
"
fileVersion
"
,
fileVersion
)
el
.
add
(
"
cmdowsVersion
"
,
self
.
v
ersion
()
)
el
.
add
(
"
cmdowsVersion
"
,
cmdowsV
ersion
)
return
def
add_contact
(
self
,
name
,
email
,
uid
,
company
=
None
,
department
=
None
,
function
=
None
,
address
=
None
,
telephone
=
None
,
country
=
None
,
roles
=
None
):
...
...
@@ -436,8 +436,9 @@ class CMDOWS(object):
performance_info_element
.
add
(
'
run_time
'
,
run_time
,
only_add_if_valued
=
True
,
camel_case_conversion
=
True
)
parent_element
.
append
(
performance_info_element
)
self
.
add_dc_verification
(
dc_uid
,
verification
[
'
method
'
],
verification
[
'
verifier
'
],
verification
[
'
result
'
],
verification
[
'
date
'
],
verification
[
'
version
'
])
if
verification
:
self
.
add_dc_verification
(
dc_uid
,
verification
[
'
method
'
],
verification
[
'
verifier
'
],
verification
[
'
result
'
],
verification
[
'
date
'
],
verification
[
'
version
'
])
return
def
add_dc_verification
(
self
,
dc_uid
,
method
,
verifier
,
result
,
date
,
version
):
...
...
@@ -499,7 +500,22 @@ class CMDOWS(object):
def
add_new_parameters_from_element
(
self
,
parameters_element
):
"""
Method to add the new parameters based on a parameters element.
"""
# TODO: Create this function...
# First ensure a parameters XPath
el
=
self
.
ensure_abs_xpath
(
'
/cmdows/parameters
'
)
# Determine the list of existing parameters
existing_parameters
=
[]
for
child
in
el
.
iterchildren
():
assert
child
.
attrib
[
'
uID
'
],
'
Attribute uID is missing for parameter element.
'
existing_parameters
.
append
(
child
.
attrib
[
'
uID
'
])
# For each element in the parameters_element determine whether it's new, and then add it (or not)
for
new_child
in
parameters_element
.
iterchildren
():
assert
new_child
.
attrib
[
'
uID
'
],
'
Attribute uID is missing for new parameter element.
'
new_child_uid
=
new_child
.
attrib
[
'
uID
'
]
if
new_child_uid
not
in
existing_parameters
:
el
.
append
(
new_child
)
return
def
add_actor
(
self
,
contact_uid
,
role
):
...
...
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