Commit 48f8c0f8 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Rename the function argument controller to automaton.

parent 848b952e
......@@ -70,7 +70,7 @@ class Automaton(object):
db (gluon.DAL): the database connection.
id_team (int): the identifier of the team in the database.
id_project (int): the identifier of the project in the database.
controller (unicode): the name of the automaton which
automaton (unicode): 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 @@ class Automaton(object):
db,
id_team,
id_project,
controller,
automaton,
id_category,
year_start=None,
year_end=None,
......@@ -101,7 +101,7 @@ class Automaton(object):
self.db = db
self.id_team = id_team
self.id_project = id_project
self.controller = controller
self.controller = automaton
self.id_category = id_category
self.year_start = year_start
self.year_end = year_end
......
......@@ -14,7 +14,7 @@ from thesis import Thesis
def build_harvester_tool(db,
id_team,
id_project,
controller,
automaton,
id_category,
year_start=None,
year_end=None,
......@@ -27,7 +27,7 @@ def build_harvester_tool(db,
db (gluon.dal.DAL): database connection.
id_team (int): the identifier of the team in the database.
id_project (int): the identifier of the project in the database.
controller (unicode): the controller defined the automaton which
automaton (unicode): the name of the automaton which
will be used to process the data. Possible values are:
``articles``, ``notes``, ``preprints``, ``proceedings``,
``reports``, ``talks`` and ``theses``.
......@@ -41,17 +41,17 @@ def build_harvester_tool(db,
Returns:
Automaton: returns the appropriate harvester automaton or
``None`` if no factory exist for the specified controller.
``None`` if no factory exist for the specified automaton.
"""
tool_class = get_harvester_tool(controller)
tool_class = get_harvester_tool(automaton)
if tool_class is None:
return None
return tool_class(db,
id_team,
id_project,
controller,
automaton,
id_category,
year_start,
year_end,
......@@ -59,12 +59,12 @@ def build_harvester_tool(db,
debug)
def get_harvester_tool(controller):
"""Get the harvester tool associated to the controller
def get_harvester_tool(automaton):
"""Get the harvester tool associated to the automaton
or None if it does not exist.
Note:
The controller defined the automaton which will be used to process
The name of the automaton which will be used to process
the data. Possible values are:
* articles
......@@ -76,32 +76,32 @@ def get_harvester_tool(controller):
* theses
Args:
controller (unicode): name of the controller
automaton (unicode): name of the automaton
Returns:
Automaton: class reference or ``None``. The latter happens
when the controller corresponds to nothing.
when the automaton corresponds to nothing.
"""
if controller == 'articles':
if automaton == 'articles':
tool_class = Articles
elif controller == 'notes':
elif automaton == 'notes':
tool_class = Notes
elif controller == 'preprints':
elif automaton == 'preprints':
tool_class = Preprints
elif controller == 'proceedings':
elif automaton == 'proceedings':
tool_class = Proceedings
elif controller == 'reports':
elif automaton == 'reports':
tool_class = Reports
elif controller == 'talks':
elif automaton == 'talks':
tool_class = Talks
elif controller == 'theses':
elif automaton == 'theses':
tool_class = Thesis
else:
......
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