Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
e3092e54
Commit
e3092e54
authored
Sep 20, 2016
by
LE GAC Renaud
Browse files
Update CheckAndFix._get_reg_institute to simplify it using itertools.
parent
2d8850fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
modules/harvest_tools/checkandfix.py
modules/harvest_tools/checkandfix.py
+5
-9
No files found.
modules/harvest_tools/checkandfix.py
View file @
e3092e54
...
...
@@ -7,6 +7,7 @@ import regex
from
base
import
search_synonym
,
ToolException
from
exception
import
CheckException
from
gluon
import
current
from
invenio_tools
import
(
DECODE_REF
,
load_record
,
MSG_NO_CONF
,
...
...
@@ -17,7 +18,7 @@ from invenio_tools import (DECODE_REF,
REG_AUTHOR
,
REG_OAI
,
REG_YEAR
)
from
gluon
import
current
from
itertools
import
imap
from
plugin_dbui
import
CLEAN_SPACES
,
get_id
...
...
@@ -111,15 +112,10 @@ class CheckAndFix(object):
# build it using the affiliation keys.
if
not
reg_institute
:
reg_institute
=
None
for
row
in
db
(
db
.
affiliation_keys
.
id
>
0
).
iterselect
():
func
=
lambda
row
:
u
"^%(key_u)s%(key_v)s"
%
row
reg
=
"^%(key_u)s%(key_v)s"
%
row
if
reg_institute
is
None
:
reg_institute
=
reg
else
:
reg_institute
=
"%s|%s"
%
(
reg_institute
,
reg
)
iterselect
=
db
(
db
.
affiliation_keys
.
id
>
0
).
iterselect
()
reg_institute
=
u
"|"
.
join
(
imap
(
func
,
iterselect
))
return
reg_institute
...
...
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