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
18963ff9
Commit
18963ff9
authored
Sep 14, 2016
by
Merret Buurman
Browse files
Return 'unknown' if handle records of children/parents are not accessible.
parent
636cbcc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
landingpage/landingpageapp/handle/cmip6parser.py
View file @
18963ff9
...
...
@@ -230,6 +230,16 @@ def _get_list_of_aggregation_records_from_record(list_of_aggregation_handles):
return
list_to_be_returned
,
any_replaced
def
_extract_info_on_one_aggregation_record
(
parenthandle
):
#
info_to_return
=
dict
(
handle
=
parenthandle
,
level
=
''
,
title
=
'(title unknown)'
,
version
=
'unknown'
,
replaced
=
False
)
replaced
=
False
# We don't know, but need to put something here...
# Retrieve handle:
try
:
...
...
@@ -253,14 +263,7 @@ def _extract_info_on_one_aggregation_record(parenthandle):
replaced
=
newer_version
)
except
ValueError
:
info_to_return
=
dict
(
handle
=
parenthandle
,
level
=
'unknown'
,
title
=
'title unknown'
,
version
=
'unknown'
,
replaced
=
'unknown'
)
replaced
=
False
# We don't know, but need to put somethine here...
pass
return
info_to_return
,
replaced
###
...
...
@@ -323,6 +326,15 @@ def _get_list_of_parts_records_from_record(record):
def
_extract_info_on_one_part_record
(
handle
):
# Create variables to be filled by data retrieved from handle
info_to_return
=
dict
(
handle
=
handle
,
level
=
'unknown'
,
title
=
'(title unknown)'
,
replaced
=
False
)
replaced
=
False
# Retrieve handle:
try
:
record
=
retrieval
.
get_handle_record_json
(
handle
)
...
...
@@ -332,7 +344,6 @@ def _extract_info_on_one_part_record(handle):
title
=
get_title_from_record
(
record
)
vers_num
=
get_version_number_from_record
(
record
)
newer_version
=
get_replaced_by_from_record
(
record
)
replaced
=
False
if
newer_version
is
not
None
and
not
newer_version
==
handle
:
replaced
=
True
...
...
@@ -347,12 +358,8 @@ def _extract_info_on_one_part_record(handle):
info_to_return
[
'version'
]
=
vers_num
except
ValueError
:
info_to_return
=
dict
(
handle
=
handle
,
level
=
'unknown'
,
title
=
'title unknown'
,
replaced
=
False
)
pass
return
info_to_return
,
replaced
...
...
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