Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XNAT-Group
XNAT_Query_Client_XSA
Commits
1ff0ca2e
Commit
1ff0ca2e
authored
Feb 19, 2015
by
Franziska Koehn
Browse files
method for getting comparison-data from json-files
parent
1f51d45a
Changes
1
Hide whitespace changes
Inline
Side-by-side
xsa/datatypereader.py
View file @
1ff0ca2e
...
...
@@ -39,6 +39,26 @@ def get_all(force=False):
return
get_all
()
get_all
.
cache
=
None
def
get_comparison_extra_source
(
root_type
):
for
data
in
get_all
():
if
data
[
'root-type'
]
==
root_type
:
if
not
'comparison_data'
in
data
or
not
data
[
'comparison_data'
]:
raise
NoComparisonDataError
(
"No comparison-data was defined for this datatype"
)
elif
not
'extra-source'
in
data
[
'comparison_data'
]
or
not
data
[
'comparison_data'
][
'extra-source'
]:
raise
NoComparisonDataError
(
"No Source of additional Data was defined for this datatype"
)
else
:
return
data
[
'comparison_data'
][
'extra-source'
]
def
get_comparison_identifier
(
root_type
):
for
data
in
get_all
():
if
data
[
'root-type'
]
==
root_type
:
if
not
'comparison_data'
in
data
or
not
data
[
'comparison_data'
]:
raise
NoComparisonDataError
(
"No comparison-data was defined for this datatype"
)
elif
not
'identifier'
in
data
[
'comparison_data'
]
or
not
data
[
'comparison_data'
][
'identifier'
]:
raise
NoComparisonDataError
(
"No Identifier for this datatype was defined"
)
else
:
return
data
[
'comparison_data'
][
'identifier'
]
def
get_rest
(
root_type
):
"""Returns REST-API-Interface of a given Root-Type, defined in its json-file.
...
...
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