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
1e486bc6
Commit
1e486bc6
authored
Apr 16, 2020
by
LE GAC Renaud
Browse files
Update automaton to define shelf
parent
cf4e7c7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
modules/harvest_tools/automaton.py
modules/harvest_tools/automaton.py
+5
-5
No files found.
modules/harvest_tools/automaton.py
View file @
1e486bc6
...
...
@@ -5,7 +5,6 @@ import logging
import
re
import
traceback
from
.base
import
(
MSG_FIX_ORIGIN
,
MSG_IN_DB
,
ToolException
)
...
...
@@ -19,7 +18,6 @@ from .msg import Msg
from
.msgcollection
import
MsgCollection
from
plugin_dbui
import
CALLBACK_ERRORS
,
get_id
MSG_NO_CAT
=
'Select a "category" !!!'
MSG_NO_PROJECT
=
'Select a "project" !!!'
MSG_NO_TEAM
=
'Select a "team" !!!'
...
...
@@ -109,6 +107,7 @@ class Automaton(object):
* team or project or the publication category not defined
"""
def
__init__
(
self
,
db
,
id_team
,
...
...
@@ -549,7 +548,7 @@ class Automaton(object):
rec_ids
=
[
el
for
el
in
rec_ids
if
func
(
ctitle
,
host
,
el
)
==
0
]
# process the remaining identifiers
(
*
map
(
self
.
process_recid
,
rec_ids
),
)
(
*
map
(
self
.
process_recid
,
rec_ids
),)
def
process_recjson
(
self
,
recjson
):
"""Process the publication provided as a JSON record:
...
...
@@ -670,13 +669,14 @@ class Automaton(object):
self
.
harvester
.
collections
=
collections
# instantiate the store
self
.
store
=
InvenioStore
(
host
)
shelf
=
(
"literature"
if
host
==
"inspirehep.net"
else
None
)
self
.
store
=
InvenioStore
(
host
,
shelf
=
shelf
)
# list of collections
collections
=
re
.
sub
(
" *, *"
,
","
,
collections
).
split
(
","
)
# process
(
*
map
(
self
.
process_collection
,
collections
),
)
(
*
map
(
self
.
process_collection
,
collections
),)
def
report
(
self
):
"""Build the processing report.
...
...
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