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
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.
......
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