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
f-interop-contributors
myslicelib
Commits
8cf19e60
Commit
8cf19e60
authored
Sep 18, 2017
by
Loic Baron
Browse files
TODO: handle SfaReg without sub-authorities
parent
1dac8f03
Changes
1
Hide whitespace changes
Inline
Side-by-side
myslicelib/api/sfareg.py
View file @
8cf19e60
...
...
@@ -76,10 +76,12 @@ class SfaReg(SfaApi):
filtered_entites
=
[]
for
record
in
result
:
# TODO: handle no sub-authorities
if
entity
==
'project'
:
if
record
[
'type'
]
==
'authority'
and
len
(
record
[
'hrn'
].
split
(
'.'
))
>
2
:
filtered_entites
.
append
(
record
)
# TODO: handle no sub-authorities
elif
entity
==
'authority'
:
if
len
(
record
[
'hrn'
].
split
(
'.'
))
<
3
:
filtered_entites
.
append
(
record
)
...
...
@@ -181,6 +183,7 @@ class SfaReg(SfaApi):
for
d
in
data
:
if
d
.
get
(
'classtype'
)
==
'authority'
:
a
=
d
.
get
(
'hrn'
)
# TODO: handle no sub-authorities
if
a
is
None
or
len
(
a
.
split
(
'.'
))
<
3
:
if
d
.
get
(
'hrn'
)
in
l_authorities
.
keys
():
l_authorities
[
d
.
get
(
'hrn'
)].
update
(
d
)
...
...
@@ -243,6 +246,7 @@ class SfaReg(SfaApi):
o
=
d
.
get
(
'hrn'
)
a
=
d
.
get
(
'authority'
)
if
d
.
get
(
'classtype'
)
==
'authority'
:
# TODO: handle no sub-authorities
if
o
is
not
None
and
len
(
o
.
split
(
'.'
))
>
2
:
if
d
.
get
(
'hrn'
)
in
l_projects
.
keys
():
l_projects
[
d
.
get
(
'hrn'
)].
update
(
d
)
...
...
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