Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Merret Buurman
pidlandingpage
Commits
cd854bdb
Commit
cd854bdb
authored
Aug 05, 2016
by
Merret Buurman
Browse files
Remove the hdl: in fields parsed from handle records.
parent
605bf065
Changes
1
Hide whitespace changes
Inline
Side-by-side
landingpage/landingpageapp/handle/cmip6parser.py
View file @
cd854bdb
...
...
@@ -177,7 +177,13 @@ def _parse_urls_replicas_from_record(field_string):
def
_get_list_of_aggregation_handles_from_record
(
record
):
field_string
=
get_aggregation_field_from_record
(
record
)
return
field_string
.
split
(
';'
)
list_of_strings
=
field_string
.
split
(
';'
)
handles
=
[]
for
member
in
list_of_strings
:
handles
.
append
(
_remove_hdl_from_handle
(
member
))
return
handles
# Retrieve info on parent dataset from handle system:
def
_get_list_of_aggregation_records_from_record
(
record
):
list_of_aggregation_handles
=
get_list_of_aggregation_handles_from_record
(
record
)
...
...
@@ -247,7 +253,9 @@ def _get_version_number_from_record(record):
return
get_value_from_record
(
record
,
'VERSION_NUMBER'
)
def
_get_replaced_by_from_record
(
record
):
return
get_value_from_record
(
record
,
'REPLACED_BY'
)
value
=
get_value_from_record
(
record
,
'REPLACED_BY'
)
handle
=
_remove_hdl_from_handle
(
value
)
return
handle
def
_get_hosts_original_from_record
(
record
):
field_string
=
get_value_from_record
(
record
,
'HOSTING_NODE'
)
...
...
@@ -261,7 +269,11 @@ def _get_hosts_replicas_from_record(record):
def
_get_list_of_parts_handles_from_record
(
record
):
field_string
=
_get_parts_field_from_record
(
record
)
return
field_string
.
split
(
';'
)
list_of_strings
=
field_string
.
split
(
';'
)
handles
=
[]
for
string
in
list_of_strings
:
handles
.
append
(
_remove_hdl_from_handle
(
string
))
return
handles
def
_get_list_of_parts_records_from_record
(
record
):
list_of_parts_handles
=
_get_list_of_parts_handles_from_record
(
record
)
...
...
@@ -343,4 +355,14 @@ def _get_all_entries_as_dict(record, include_special_types=True):
pass
else
:
record_dict
[
key
]
=
str
(
get_value_from_record
(
record
,
key
))
return
record_dict
\ No newline at end of file
return
record_dict
# Helper
def
_remove_hdl_from_handle
(
handle
):
if
handle
is
not
None
:
if
handle
.
startswith
(
'hdl:'
):
return
handle
.
replace
(
'hdl:'
,
''
)
else
:
return
handle
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment