Commit 265f6cbf authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Sphinx documentation for the invenio_tools.base module.

parent a88001a3
invenio_tools.base.is_conference
================================
.. currentmodule:: invenio_tools.base
.. autofunction:: is_conference
\ No newline at end of file
invenio_tools.base.is_institute
===============================
.. currentmodule:: invenio_tools.base
.. autofunction:: is_institute
\ No newline at end of file
invenio_tools.base.is_thesis
============================
.. currentmodule:: invenio_tools.base
.. autofunction:: is_thesis
\ No newline at end of file
Harvesters
----------
Harvest_tools
-------------
Constants
^^^^^^^^^
DRY_RUN
MSG_CRASH
MSG_FIX_ORIGIN
MSG_IN_DB
MSG_LOAD
============== =========================
DRY_RUN "dry run"
MSG_CRASH "Crash: %s"
MSG_FIX_ORIGIN "Fixed the origin field"
MSG_IN_DB "Already in the database"
MSG_LOAD "Load in the database"
============== =========================
Factory
^^^^^^^
......
......@@ -9,6 +9,7 @@ API Documentation
.. toctree::
:maxdepth: 2
invenio
harvester
Indices and tables
......
invenio_tools
-------------
Constants
^^^^^^^^^
================ =================================
ARXIV "arXiv"
ARXIV_PDF "http://arxiv.org/pdf/"
MSG_NO_CONF "Reject no conference information"
MSG_NO_THESIS "Reject no thesis information"
OAI_URL "http://%s/record/%s"
REG_ARXIV_NUMBER r"\d+\.\d+"
REG_AUTHOR r"(.+), (\S+)( |\-)*(\S+)*"
REG_OAI r"oai:([a-z\.]+):([\d]+)"
REG_YEAR r"(\d{4})
THESIS_DIR u"dir."
================ =================================
Helper functions
^^^^^^^^^^^^^^^^
.. currentmodule:: invenio_tools.base
.. autosummary::
:toctree: generated/
is_conference
is_institute
is_thesis
Classes
^^^^^^^
\ No newline at end of file
......@@ -35,11 +35,12 @@ def is_conference(record):
"""True when the record describes a publication related to a conference.
Args:
record (Record):
record (Record): MARC12 record associated to a publication
or to and institute.
Return:
bool: true when the MARC record describes a publication related
to a conference.
bool: ``True`` when the MARC record describes a publication related
to a conference.
"""
if u"111" in record:
......@@ -60,10 +61,11 @@ def is_institute(record):
"""True when the record describes an institute.
Args:
record (Record):
record (Record): MARC12 record associated to a publication
or to and institute.
Return:
bool: true when the MARC record describes an institute
bool: ``True`` when the MARC record describes an institute.
"""
# u'980': [
......@@ -90,10 +92,11 @@ def is_thesis(record):
"""True when the record describes a thesis.
Args:
record (Record):
record (Record): MARC12 record associated to a publication
or to and institute.
Return:
bool: true when the MARC record describes a thesis
bool: ``True`` when the MARC record describes a thesis.
"""
li = record._get(u"980", "a", force_list=True)
......
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