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

Update factorey.build_store

parent 0146901a
......@@ -17,6 +17,7 @@ from .base import (CDS,
from datetime import datetime
from .exception import CdsException
from .inveniostore import InvenioStore
from .inspirehepstore import InspirehepStore
from .recordconf import RecordConf
from .recordinst import RecordInst
from .recordpubli import RecordPubli
......@@ -242,9 +243,9 @@ def build_store(host=None, shelf=None):
| cds.cern.ch | None | https://cds.cern.ch/ |
+----------------+--------------+-----------------------------+
| inspirehep.net | None | https://old.inspirehep.net/ |
| inspirehep.net | literature | https://old.inspirehep.net/ |
| inspirehep.net | literature | https://inspirehep.net/ |
| inspirehep.net | conferences | https://inspirehep.net/ |
| inspirehep.net | institutions | https://old.inspirehep.net/ |
| inspirehep.net | institutions | https://inspirehep.net/ |
+----------------+--------------+-----------------------------+
Returns:
......@@ -252,25 +253,13 @@ def build_store(host=None, shelf=None):
"""
if host in CDS:
store = InvenioStore(
host="cds.cern.ch",
api_record="https://cds.cern.ch/record",
api_search="https://cds.cern.ch/search",
shelf=shelf)
elif host in INS and shelf in (None, "literature", "institutions"):
store = InvenioStore(
host="old.inspirehep.net",
api_record="https://old.inspirehep.net/record",
api_search="https://old.inspirehep.net/search",
shelf=shelf)
elif host in INS and shelf in ("conferences",):
store = InvenioStore(
host="inspirehep.net",
api_record="https://inspirehep.net/api/conferences",
api_search="https://inspirehep.net/api/conferences/?q=",
shelf=shelf)
store = InvenioStore(host="cds.cern.ch")
elif host in INS and shelf is None:
store = InvenioStore(host="old.inspirehep.net")
elif host in INS:
store = InspirehepStore(host=host, shelf=shelf)
else:
raise CdsException(MSG_NO_SHELF % (shelf, host))
......
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