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 @@
import json
import re
from check_tools import check_publication
from gluon.storage import Storage
from harvest_tools import DRY_RUN
......@@ -18,7 +17,6 @@ from plugin_dbui import (CALLBACK_ERRORS,
Selector,
to_fields)
MODE_DRY_RUN = T(DRY_RUN)
MSG_NO_AUTHORS = "<br><br>Removing affiliation failed.<br>"\
"Use INSPIRES instead with the tool 'insert RECJSON'"
......@@ -475,7 +473,7 @@ def update_citations():
# interrogate inspirehep.net
try:
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()
if not isinstance(lst, list):
......
......@@ -12,7 +12,7 @@ invenio_tools.inveniostore.InvenioStore
~InvenioStore.get_ids
~InvenioStore.get_record
~InvenioStore.interogate
~InvenioStore.interrogate
~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):
or ``inspirehep.net``
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``
and ``institutions``
......@@ -96,7 +96,7 @@ class InvenioStore(object):
# close the session
self._session.close()
def interogate(self, url, timeout=10, **kwargs):
def interrogate(self, url, timeout=10, **kwargs):
"""Interrogate the store using the *URL*.
It is retry several time when the service is not available.
......@@ -461,7 +461,7 @@ class InvenioStore(object):
while scan:
kwargs["jrec"] += N_IDS
rep = self.interogate(self._api_search, timeout=30, **kwargs)
rep = self.interrogate(self._api_search, timeout=30, **kwargs)
try:
li = rep.json()
......@@ -506,7 +506,7 @@ class InvenioStore(object):
if self._host in ("cds.cern.ch", "old.inspirehep.net"):
kwargs = {"of": "recjson"}
rep = self.interogate(url, timeout=30, **kwargs)
rep = self.interrogate(url, timeout=30, **kwargs)
try:
li = rep.json()
......
......@@ -95,7 +95,7 @@ def get_citations(store, url):
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")
......
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