Commit 1e486bc6 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update automaton to define shelf

parent cf4e7c7c
...@@ -5,7 +5,6 @@ import logging ...@@ -5,7 +5,6 @@ import logging
import re import re
import traceback import traceback
from .base import (MSG_FIX_ORIGIN, from .base import (MSG_FIX_ORIGIN,
MSG_IN_DB, MSG_IN_DB,
ToolException) ToolException)
...@@ -19,7 +18,6 @@ from .msg import Msg ...@@ -19,7 +18,6 @@ from .msg import Msg
from .msgcollection import MsgCollection from .msgcollection import MsgCollection
from plugin_dbui import CALLBACK_ERRORS, get_id from plugin_dbui import CALLBACK_ERRORS, get_id
MSG_NO_CAT = 'Select a "category" !!!' MSG_NO_CAT = 'Select a "category" !!!'
MSG_NO_PROJECT = 'Select a "project" !!!' MSG_NO_PROJECT = 'Select a "project" !!!'
MSG_NO_TEAM = 'Select a "team" !!!' MSG_NO_TEAM = 'Select a "team" !!!'
...@@ -109,6 +107,7 @@ class Automaton(object): ...@@ -109,6 +107,7 @@ class Automaton(object):
* team or project or the publication category not defined * team or project or the publication category not defined
""" """
def __init__(self, def __init__(self,
db, db,
id_team, id_team,
...@@ -549,7 +548,7 @@ class Automaton(object): ...@@ -549,7 +548,7 @@ class Automaton(object):
rec_ids = [el for el in rec_ids if func(ctitle, host, el) == 0] rec_ids = [el for el in rec_ids if func(ctitle, host, el) == 0]
# process the remaining identifiers # process the remaining identifiers
(*map(self.process_recid, rec_ids), ) (*map(self.process_recid, rec_ids),)
def process_recjson(self, recjson): def process_recjson(self, recjson):
"""Process the publication provided as a JSON record: """Process the publication provided as a JSON record:
...@@ -670,13 +669,14 @@ class Automaton(object): ...@@ -670,13 +669,14 @@ class Automaton(object):
self.harvester.collections = collections self.harvester.collections = collections
# instantiate the store # instantiate the store
self.store = InvenioStore(host) shelf = ("literature" if host == "inspirehep.net" else None)
self.store = InvenioStore(host, shelf=shelf)
# list of collections # list of collections
collections = re.sub(" *, *", ",", collections).split(",") collections = re.sub(" *, *", ",", collections).split(",")
# process # process
(*map(self.process_collection, collections), ) (*map(self.process_collection, collections),)
def report(self): def report(self):
"""Build the processing report. """Build the processing report.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment