Commit fd4bd999 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Rename InveniStore.interogate to interrogate.

parent 280a0bfe
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import json import json
import re import re
from check_tools import check_publication from check_tools import check_publication
from gluon.storage import Storage from gluon.storage import Storage
from harvest_tools import DRY_RUN from harvest_tools import DRY_RUN
...@@ -18,7 +17,6 @@ from plugin_dbui import (CALLBACK_ERRORS, ...@@ -18,7 +17,6 @@ from plugin_dbui import (CALLBACK_ERRORS,
Selector, Selector,
to_fields) to_fields)
MODE_DRY_RUN = T(DRY_RUN) MODE_DRY_RUN = T(DRY_RUN)
MSG_NO_AUTHORS = "<br><br>Removing affiliation failed.<br>"\ MSG_NO_AUTHORS = "<br><br>Removing affiliation failed.<br>"\
"Use INSPIRES instead with the tool 'insert RECJSON'" "Use INSPIRES instead with the tool 'insert RECJSON'"
...@@ -475,7 +473,7 @@ def update_citations(): ...@@ -475,7 +473,7 @@ def update_citations():
# interrogate inspirehep.net # interrogate inspirehep.net
try: try:
url = rex_ins.search(row.origin).group(1) url = rex_ins.search(row.origin).group(1)
rep = store.interogate(url, timeout=60, **kwargs) rep = store.interrogate(url, timeout=60, **kwargs)
lst = rep.json() lst = rep.json()
if not isinstance(lst, list): if not isinstance(lst, list):
......
...@@ -12,7 +12,7 @@ invenio_tools.inveniostore.InvenioStore ...@@ -12,7 +12,7 @@ invenio_tools.inveniostore.InvenioStore
~InvenioStore.get_ids ~InvenioStore.get_ids
~InvenioStore.get_record ~InvenioStore.get_record
~InvenioStore.interogate ~InvenioStore.interrogate
~InvenioStore.last_search_url ~InvenioStore.last_search_url
......
invenio_tools.inveniostore.InvenioStore.interogate
==================================================
.. currentmodule:: invenio_tools.inveniostore
.. automethod:: InvenioStore.interogate
\ No newline at end of file
invenio_tools.inveniostore.InvenioStore.interrogate
===================================================
.. currentmodule:: invenio_tools.inveniostore
.. automethod:: InvenioStore.interrogate
...@@ -41,7 +41,7 @@ class InvenioStore(object): ...@@ -41,7 +41,7 @@ class InvenioStore(object):
or ``inspirehep.net`` or ``inspirehep.net``
shelf (str): shelf (str):
section of the store. It depends on the host. section of the store containing records. It depends on the host.
Possible values are ``None``, ``literature``, ``conferences`` Possible values are ``None``, ``literature``, ``conferences``
and ``institutions`` and ``institutions``
...@@ -96,7 +96,7 @@ class InvenioStore(object): ...@@ -96,7 +96,7 @@ class InvenioStore(object):
# close the session # close the session
self._session.close() self._session.close()
def interogate(self, url, timeout=10, **kwargs): def interrogate(self, url, timeout=10, **kwargs):
"""Interrogate the store using the *URL*. """Interrogate the store using the *URL*.
It is retry several time when the service is not available. It is retry several time when the service is not available.
...@@ -461,7 +461,7 @@ class InvenioStore(object): ...@@ -461,7 +461,7 @@ class InvenioStore(object):
while scan: while scan:
kwargs["jrec"] += N_IDS kwargs["jrec"] += N_IDS
rep = self.interogate(self._api_search, timeout=30, **kwargs) rep = self.interrogate(self._api_search, timeout=30, **kwargs)
try: try:
li = rep.json() li = rep.json()
...@@ -506,7 +506,7 @@ class InvenioStore(object): ...@@ -506,7 +506,7 @@ class InvenioStore(object):
if self._host in ("cds.cern.ch", "old.inspirehep.net"): if self._host in ("cds.cern.ch", "old.inspirehep.net"):
kwargs = {"of": "recjson"} kwargs = {"of": "recjson"}
rep = self.interogate(url, timeout=30, **kwargs) rep = self.interrogate(url, timeout=30, **kwargs)
try: try:
li = rep.json() li = rep.json()
......
...@@ -95,7 +95,7 @@ def get_citations(store, url): ...@@ -95,7 +95,7 @@ def get_citations(store, url):
number of citations number of citations
""" """
kwargs = dict(of="recjson", ot="number_of_citations") kwargs = dict(of="recjson", ot="number_of_citations")
rep = store.interogate(url, timeout=10, **kwargs) rep = store.interrogate(url, timeout=10, **kwargs)
return rep.json()[0].get("number_of_citations") return rep.json()[0].get("number_of_citations")
......
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