Пример #1
0
    extract_references_from_file,
    extract_references_from_string,
)

from inspirehep.modules.workflows.utils import (
    ignore_timeout_error,
    timeout_with_config,
)

from inspirehep.utils.references import (
    local_refextract_kbs_path,
    map_refextract_to_schema,
)
from ..utils import with_debug_logging

LOGGER = getStackTraceLogger(__name__)


@with_debug_logging
def extract_journal_info(obj, eng):
    """Extract the journal information from ``pubinfo_freetext``.

    Runs ``extract_journal_reference`` on the ``pubinfo_freetext`` key of each
    ``publication_info``, if it exists, and uses the extracted information to
    populate the other keys.

    Args:
        obj: a workflow object.
        eng: a workflow engine.

    Returns:
Пример #2
0
from sqlalchemy.orm.exc import FlushError
from time_execution import time_execution

from invenio_oauthclient.utils import oauth_link_external_id
from invenio_oauthclient.models import RemoteToken, User, RemoteAccount, UserIdentity
from invenio_db import db
from invenio_oauthclient.errors import AlreadyLinkedError
from inspire_utils.logging import getStackTraceLogger
from inspire_utils.record import get_value
from inspirehep.modules.orcid import exceptions as domain_exceptions
from inspirehep.modules.orcid.utils import get_literature_recids_for_orcid

from . import domain_models, push_access_tokens


LOGGER = getStackTraceLogger(__name__)
USER_EMAIL_EMPTY_PATTERN = '{}@FAKEEMAILINSPIRE.FAKE'


def legacy_orcid_arrays():
    """
    Generator to fetch token data from redis.

    Note: this function consumes the queue populated by the legacy tasklet:
    inspire/bibtasklets/bst_orcidsync.py

    Yields:
        list: user data in the form of [orcid, token, email, name]
    """
    redis_url = current_app.config.get('CACHE_REDIS_URL')
    r = StrictRedis.from_url(redis_url)