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

Update modules to replace unicode by str in doctring.

parent b2878afb
......@@ -92,12 +92,12 @@ class Articles(Automaton):
found later by the harvester.
Args:
oai_url (unicode):
oai_url (str):
the oai_url, *e.g* ``http://cds.cern.ch/record/123456``.
The origin field of the existing database record is update
to **oai_url** when a match is found.
year (unicode):
year (str):
the year of the publication. It is used
by the search algorithm and by the logger.
......@@ -105,22 +105,22 @@ class Articles(Automaton):
id_publisher (int):
identifier of the publisher in the database.
my_authors (unicode):
my_authors (str):
authors of my institute separated by a comma.
pages (unicode):
pages (str):
the page reference.
publication_url (unicode):
publication_url (str):
the URL of the publications
preprint_number (unicode):
preprint_number (str):
the preprint number
title (unicode):
title (str):
the title of the publication.
volume (unicode):
volume (str):
the volume reference.
Returns:
......@@ -209,11 +209,11 @@ class Articles(Automaton):
All the keyword arguments are needed by the transformation.
Args:
primary_oai_url (unicode):
primary_oai_url (str):
the *primary* OAI identifier of the
record. It is used by the search algorithm.
year (unicode):
year (str):
the year of publication which is used
by the logger.
......@@ -221,22 +221,22 @@ class Articles(Automaton):
id_publisher (int):
identifier of the publisher in the database.
my_authors (unicode):
my_authors (str):
authors of my institute separated by a comma.
oai_url (unicode):
oai_url (str):
the full oai_url(s) of the article.
pages (unicode):
pages (str):
the page reference.
publication_url (unicode):
publication_url (str):
the URL of the publications
title (unicode):
title (str):
the title of the publication.
volume (unicode):
volume (str):
the volume reference.
Returns:
......
......@@ -82,7 +82,7 @@ class Automaton(object):
id_project (int):
the identifier of the project in the database.
automaton (unicode):
automaton (str):
the name of the automaton which will be used to process the data.
Possible values are: ``articles``, ``notes``, ``preprints``,
``proceedings``, ``reports``, ``talks`` and ``theses``.
......@@ -210,14 +210,14 @@ class Automaton(object):
title (str): the title of the publication.
Keyword Args:
host (unicode):
host (str):
the store. possible values are ``cds.cern.ch`` or
``inspirehep.net``. To be used with *rec_id*.
rec_id (int):
the record identifier in the store
oai_url (unicode):
oai_url (str):
the URL of the record in the store.
Either use *host* and *rec_id* or *oai_url*
......@@ -297,7 +297,7 @@ class Automaton(object):
in the selector.
Args:
collection (unicode):
collection (str):
string defining the collection in the store.
The syntax depends on the invenio store:
......@@ -420,7 +420,7 @@ class Automaton(object):
and found later by an harvester.
Args:
oai_url (unicode):
oai_url (str):
the oai_url, *e.g.* ``http://cds.cern.ch/record/123456``.
The origin field of the existing database record is update to
**oai_url** when a match is found.
......@@ -430,7 +430,7 @@ class Automaton(object):
by the search algorithm and by the logger.
Keyword Args:
kwargs (unicode):
kwargs (str):
a series of key, value pair where the key is the name of a
publications database field.
......@@ -495,7 +495,7 @@ class Automaton(object):
collection. Corresponding records are inserted in the database.
Args:
collection (unicode):
collection (str):
name of the collection to be interrogated.
Note:
......@@ -652,11 +652,11 @@ class Automaton(object):
in order to understand what happen.
Args:
host (unicode):
host (str):
host name to query for publications, either
``cds.cern.ch`` or ``inspirehep.net``.
collections (unicode):
collections (str):
list of collection to be interrogated.
Collections are separated by a comma.
......@@ -683,7 +683,7 @@ class Automaton(object):
Returns:
dict:
* ``collection_logs`` list of :class:`MsgCollection`
* ``controller`` unicode
* ``controller`` str
* ``logs`` list of :class:`Msg`
* ``selector`` :class:`plugin_dbui.Selector`
......
......@@ -19,11 +19,11 @@ def family_name_fr(full_name):
"""Extract the family name when the full name is encoded as ``J. Doe``.
Args:
full_name (unicode):
full_name (str):
author name encoded according to French typographic rules.
Returns:
unicode:
str:
family name
"""
......@@ -110,10 +110,10 @@ def search_synonym(table, fieldname, value, create=False):
table (gluon.DAL.Table):
database table.
fieldname (unicode):
fieldname (str):
field of the database table identified by its name.
value (unicode):
value (str):
value to be matched.
create(bool):
......
......@@ -299,7 +299,7 @@ class CheckAndFix(object):
record describing a publication.
Returns:
unicode:
str:
target at least YYYY-MM
empty when procedure failed
......@@ -660,7 +660,7 @@ class CheckAndFix(object):
record (RecordPubli):
record describing a publication.
sep (unicode):
sep (str):
string separating author names. The default is the comma.
sort (bool):
......@@ -668,7 +668,7 @@ class CheckAndFix(object):
order of authors at the creation of the record
Returns:
unicode:
str:
the list of authors separated by the ``sep`` argument.
Raises:
......
......@@ -32,7 +32,7 @@ def build_harvester_tool(db,
id_project (int):
the identifier of the project in the database.
automaton (unicode):
automaton (str):
the name of the automaton which will be used to process the data.
Possible values are ``articles``, ``notes``, ``preprints``,
``proceedings``, ``reports``, ``talks`` and ``theses``.
......@@ -90,7 +90,7 @@ def get_harvester_tool(automaton):
* theses
Args:
automaton (unicode):
automaton (str):
name of the automaton
Returns:
......
......@@ -26,7 +26,7 @@ class Msg(Storage):
* *reject* the record is rejected.
Args:
collection (unicode):
collection (str):
the harvester collection used to search the record.
harvester (gluon.dal.Row):
......@@ -35,7 +35,7 @@ class Msg(Storage):
record_id (int):
the record identifier in the store.
title (unicode):
title (str):
the title of the publication.
"""
......@@ -64,10 +64,10 @@ class Msg(Storage):
"""Set the action as *idle* and the explanation as ``txt``.
Args:
txt (unicode):
txt (str):
message associated to the action.
year (unicode):
year (str):
year of the publication
translate (bool):
......@@ -81,10 +81,10 @@ class Msg(Storage):
"""Set the action as *load* and the explanation as ``txt``.
Args:
txt (unicode):
txt (str):
message associated to the action.
year (unicode):
year (str):
year of the publication
translate (bool):
......@@ -98,10 +98,10 @@ class Msg(Storage):
"""Set the action as *modify* and the explanation as ``txt``.
Args:
txt (unicode):
txt (str):
message associated to the action.
year (unicode):
year (str):
year of the publication
translate (bool):
......@@ -115,10 +115,10 @@ class Msg(Storage):
"""Set the action as *reject* and the explanation as ``txt``.
Args:
txt (unicode):
txt (str):
message associated to the action.
year (unicode):
year (str):
year of the publication
record (RecordPubli):
......
......@@ -8,16 +8,16 @@ class MsgCollection(Storage):
"""Messages for a collection.
Args:
error (unicode):
error (str):
error when scanning the collection.
found (int):
number of publication found in the harvester repository.
url (unicode):
url (str):
URL used to scan the harvester repository.
title (unicode):
title (str):
title of the collection.
"""
......
......@@ -177,14 +177,14 @@ def get_conference_data(host, conf_id=None, key=None):
"""Get the conference data identified by its id or key.
Args:
host (unicode):
host (str):
possible values are ``cds.cern.ch`` or ``inspirehep.net``.
conf_id (int):
the conference identifier in the store.
This is the preferred way.
key (unicode): the conference key in the store.
key (str): the conference key in the store.
Returns:
dict:
......@@ -252,7 +252,7 @@ def match_conference_key(recjson, conf_key):
recjson (dict):
record formatted MarcJSON.
conf_key (unicode):
conf_key (str):
conference key
Returns
......
......@@ -60,7 +60,7 @@ class InvenioStore(object):
It is retry several time when the service is not available.
Args:
url (unicode):
url (str):
URL string, *e.g.*::
* ``https://cds.cern.ch/record/123456/of=recjson``
......@@ -456,7 +456,7 @@ class InvenioStore(object):
def last_search_url(self):
"""
Returns:
unicode:
str:
the URL used in the last search.
"""
......
......@@ -128,17 +128,17 @@ class Record(dict):
"""Get the value associated to the ``field`` and ``subfield``.
Args:
field (unicode):
field (str):
name of the field, *e.g.* ``authors``
subfield (unicode):
subfield (str):
name of the subfield, *e.g.* ``full_name``
force_list (bool):
always return a *list* when ``True``.
Returns:
unicode:
str:
value or an empty string when not defined.
list:
......@@ -168,11 +168,11 @@ class Record(dict):
"""Build the Open Archive Initiative URL.
Args:
value (unicode):
value (str):
OAI identifier, *e.g.* ``oai:host:id``
Returns:
unicode:
str:
the pattern of the string is ``http://host/record/id``.
The string is empty when it is not defined or when the value
is not well formed.
......@@ -194,7 +194,7 @@ class Record(dict):
"""The store housing the record.
Returns:
unicode:
str:
``inspirehep.net`` or ``cds.cern.ch`` or an empty string
when not defined.
......@@ -229,7 +229,7 @@ class Record(dict):
"""The Open Archive Initiative identifier(s).
Returns:
unicode:
str:
the primary and secondary OAI identifier are separated
by a comma. The pattern of the identifier is ``oai:host:id`` or
an empty string when it is not defined.
......@@ -249,7 +249,7 @@ class Record(dict):
"""The Open Archive Initiative identifier URL(s).
Returns:
unicode:
str:
the primary and secondary URLs are separated by a comma.
The pattern of the URL is ``http://host/record/id`` or
an empty string when it is not defined or when the OAI is
......@@ -272,7 +272,7 @@ class Record(dict):
The primary OAI identifier matches the record identifier.
Returns:
unicode:
str:
the pattern of the string is ``oai:host:id``.
It is an empty string when not defined
......@@ -311,7 +311,7 @@ class Record(dict):
a new *id* and new *URL* which is return by this method.
Returns:
unicode:
str:
the pattern of the string is ``http://host/record/id``.
The string is empty when it is not defined or when the OAI
is not well formed.
......@@ -333,7 +333,7 @@ class Record(dict):
corresponds to the record in the other store, *inspirehep.net*.
Returns:
unicode:
str:
the pattern of the string is ``oai:host:id``.
It is an empty string when not defined
......@@ -362,7 +362,7 @@ class Record(dict):
"""The Open Archive Initiative URL for the secondary OAI.
Returns:
unicode:
str:
the pattern of the string is ``http://host/record/id``.
The string is empty when it is not defined or when the OAI
is not well formed.
......
......@@ -30,7 +30,7 @@ class RecordConf(RecordPubli):
"""The country where the conference took place.
Returns:
unicode:
str:
the filter *CLEAN_SPACES* is applied.
The string is empty when the country is not defined.
......@@ -53,7 +53,7 @@ class RecordConf(RecordPubli):
"""The dates of the conference.
Returns:
unicode:
str:
the usual pattern is ``6-5 March 2012`` but it can varies
between records and between stores since it is not
standardise.
......@@ -77,7 +77,7 @@ class RecordConf(RecordPubli):
"""The conference key used in the store.
Returns:
unicode:
str:
empty string when not defined
"""
......@@ -103,7 +103,7 @@ class RecordConf(RecordPubli):
"""The conference location.
Returns:
unicode:
str:
- the pattern is ``town, country``
- empty string when more than one location found
- empty string when not defined
......@@ -130,7 +130,7 @@ class RecordConf(RecordPubli):
"""The town where the conference took place.
Returns:
unicode:
str:
empty string when it is not defined.
"""
......@@ -145,7 +145,7 @@ class RecordConf(RecordPubli):
"""The URL of the conference home page.
Returns:
unicode:
str:
select arbitrarily the first URL when severals
are founded. The string is empty string when the URL
is not defined.
......@@ -157,7 +157,7 @@ class RecordConf(RecordPubli):
"""The year of the conference.
Returns:
unicode:
str:
empty string when it is not defined.
"""
......
......@@ -77,7 +77,7 @@ class RecordInst(Record):
"""Future identifier of the institute.
Returns:
unicode:
str:
the future inspirehep identifier or an empty string
if the identifier is not defined.
......@@ -88,7 +88,7 @@ class RecordInst(Record):
"""Identifier of the institute.
Returns:
unicode:
str:
the current inspirehep identifier (2015) or an empty
string if it is not defined.
......@@ -99,7 +99,7 @@ class RecordInst(Record):
""" Name of the institute.
Returns:
unicode:
str:
- the name of the institute.
- an empty string when it is not defined.
......@@ -114,7 +114,7 @@ class RecordInst(Record):
""" Regular expression to search authors affiliate to the institute.
Returns:
unicode:
str:
the regular expression to search author affiliate
to the institute in the store ``cds.cern.ch`` or
``inspirehep.net``.
......
......@@ -45,10 +45,10 @@ def to_initial(name):
+------------------+----------+
Args:
name (unicode):
name (str):
Returns:
unicode
str
"""
if len(name) == 0:
......@@ -412,7 +412,7 @@ class RecordPubli(Record):
pattern (str):
regular expression defining the author name(s).
sep (unicode):
sep (str):
string separating author names. The default is the comma.
sort (bool):
......@@ -450,7 +450,7 @@ class RecordPubli(Record):
regular expression defining the affiliation keys
for the institute(s).
sep (unicode):
sep (str):
string separating author names. The default is the comma.
sort (bool):
......@@ -484,7 +484,7 @@ class RecordPubli(Record):
"""The name of the first author.
Returns:
unicode:
str:
empty string when the first author is not defined.
"""
......@@ -610,7 +610,7 @@ class RecordPubli(Record):
"""The abbreviated version of the review, *e.g* Phys Lett B.
Returns:
unicode:
str:
empty string when not defined.
"""
......@@ -621,7 +621,7 @@ class RecordPubli(Record):
"""The page number / range when the record is published in a review.
Returns:
unicode:
str:
* The format is "45-67" or "234".
* Empty string when not defined.
......@@ -633,7 +633,7 @@ class RecordPubli(Record):
"""The full reference for a publication published in a review.
Returns:
unicode:
str:
* The format is "Phys Lett B 456 2010 5-6".
* The string is empty when the publication is not
published in a review.
......@@ -655,7 +655,7 @@ class RecordPubli(Record):
Many others URL exists mainly those related to open access.
Returns:
unicode:
str:
the string is empty when no URLs are found.
"""
......@@ -686,7 +686,7 @@ class RecordPubli(Record):
"""The volume number when the record is published in a review.
Returns:
unicode:
str:
empty string when nothing is found.
"""
......@@ -697,7 +697,7 @@ class RecordPubli(Record):
"""The year of the publication.
Returns:
unicode:
str:
- Empty string if the year is not defined.