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

Rename the class PublicationsTool to Automaton.

parent 7c9997ac
...@@ -6,10 +6,10 @@ import traceback ...@@ -6,10 +6,10 @@ import traceback
from gluon import current from gluon import current
from gluon.restricted import RestrictedError from gluon.restricted import RestrictedError
from harvest_tools import (format_author_fr, from harvest_tools import (Automaton,
family_name_fr,
build_harvester_tool, build_harvester_tool,
PublicationsTool, format_author_fr,
family_name_fr,
ToolException) ToolException)
from invenio_tools import (CheckAndFix, from invenio_tools import (CheckAndFix,
CheckException, CheckException,
...@@ -124,15 +124,15 @@ def edit_insert(): ...@@ -124,15 +124,15 @@ def edit_insert():
values = {} values = {}
check = CheckAndFix() check = CheckAndFix()
# NOTE: the publication tool is only require to extract # NOTE
# the list of my authors # publication tool is only require to extract the list of my authors
tool = PublicationsTool(db, tool = Automaton(db,
selector.id_teams, selector.id_teams,
selector.id_projects, selector.id_projects,
selector.controller, selector.controller,
selector.id_categories, selector.id_categories,
dry_run=True, dry_run=True,
debug=False) debug=False)
# title, preprint, URL, report number # title, preprint, URL, report number
values['PublicationsTitle'] = record.title() values['PublicationsTitle'] = record.title()
...@@ -387,4 +387,4 @@ def run_all(): ...@@ -387,4 +387,4 @@ def run_all():
return dict(collection_logs=collection_logs, return dict(collection_logs=collection_logs,
controller='all harvesters', controller='all harvesters',
logs=logs, logs=logs,
selector=selector) selector=selector)
\ No newline at end of file
...@@ -8,11 +8,11 @@ from base import (DRY_RUN, ...@@ -8,11 +8,11 @@ from base import (DRY_RUN,
format_author_fr, format_author_fr,
ToolException) ToolException)
from automaton import Automaton
from articles import Articles
from factory import build_harvester_tool, get_harvester_tool from factory import build_harvester_tool, get_harvester_tool
from msg import Msg from msg import Msg
from msgcollection import MsgCollection from msgcollection import MsgCollection
from publicationstool import PublicationsTool
from articles import Articles
from notes import Notes from notes import Notes
from preprints import Preprints from preprints import Preprints
from proceedings import Proceedings from proceedings import Proceedings
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_FIX_ORIGIN, MSG_IN_DB, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_FIX_ORIGIN, MSG_IN_DB, MSG_LOAD
from invenio_tools import CheckException from invenio_tools import CheckException
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID from plugin_dbui import get_id, UNDEF_ID
...@@ -15,13 +15,13 @@ MSG_NO_EDITOR = "Reject article is not published" ...@@ -15,13 +15,13 @@ MSG_NO_EDITOR = "Reject article is not published"
MSG_TRANSFORM_PREPRINT = "Transform the preprint into an article" MSG_TRANSFORM_PREPRINT = "Transform the preprint into an article"
class Articles(PublicationsTool): class Articles(Automaton):
"""Publications tool for articles. """Publications tool for articles.
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
PublicationsTool.__init__(self, *args, **kwargs) Automaton.__init__(self, *args, **kwargs)
# the preprint categories # the preprint categories
self.id_preprint = get_id(self.db.categories, code="PRE") self.id_preprint = get_id(self.db.categories, code="PRE")
...@@ -272,7 +272,7 @@ class Articles(PublicationsTool): ...@@ -272,7 +272,7 @@ class Articles(PublicationsTool):
@rtype: bool @rtype: bool
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" harvest_tools.publicationstool """ harvest_tools.automaton
""" """
import re import re
...@@ -27,7 +27,7 @@ MSG_NO_OAI = "Reject no OAI identifier" ...@@ -27,7 +27,7 @@ MSG_NO_OAI = "Reject no OAI identifier"
MSG_WELL_FORM_OAI = "Reject OAI is not well formed" MSG_WELL_FORM_OAI = "Reject OAI is not well formed"
class PublicationsTool(object): class Automaton(object):
"""Base class to search and process publications. """Base class to search and process publications.
- Decode the parameter of a selector defining user criteria. - Decode the parameter of a selector defining user criteria.
- Search for publications in the store, according to - Search for publications in the store, according to
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException from invenio_tools import CheckException
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID from plugin_dbui import get_id, UNDEF_ID
class Notes(PublicationsTool): class Notes(Automaton):
"""Publications tool for notes. """Publications tool for notes.
""" """
...@@ -74,7 +74,7 @@ class Notes(PublicationsTool): ...@@ -74,7 +74,7 @@ class Notes(PublicationsTool):
@rtype: bool @rtype: bool
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException, RecordConf, RecordThesis from invenio_tools import CheckException, RecordConf, RecordThesis
from publicationstool import PublicationsTool
from plugin_dbui import UNDEF_ID from plugin_dbui import UNDEF_ID
...@@ -17,7 +17,7 @@ MSG_PREPRINT_IS_THESIS = "Reject preprint is a thesis" ...@@ -17,7 +17,7 @@ MSG_PREPRINT_IS_THESIS = "Reject preprint is a thesis"
MSG_PREPRINT_NO_NUMBER = "Reject no preprint number" MSG_PREPRINT_NO_NUMBER = "Reject no preprint number"
class Preprints(PublicationsTool): class Preprints(Automaton):
"""Publications tool for preprints. """Publications tool for preprints.
""" """
...@@ -86,7 +86,7 @@ class Preprints(PublicationsTool): ...@@ -86,7 +86,7 @@ class Preprints(PublicationsTool):
@param record: @param record:
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException from invenio_tools import CheckException
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID from plugin_dbui import get_id, UNDEF_ID
class Proceedings(PublicationsTool): class Proceedings(Automaton):
"""Publications tool for conference proceedings. """Publications tool for conference proceedings.
""" """
...@@ -118,7 +118,7 @@ class Proceedings(PublicationsTool): ...@@ -118,7 +118,7 @@ class Proceedings(PublicationsTool):
@rtype: bool @rtype: bool
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException from invenio_tools import CheckException
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID, UNKNOWN from plugin_dbui import get_id, UNDEF_ID, UNKNOWN
MSG_REPORT_NO_NUMBER = "Reject no report number" MSG_REPORT_NO_NUMBER = "Reject no report number"
class Reports(PublicationsTool): class Reports(Automaton):
"""Publications tool for reports to committee. """Publications tool for reports to committee.
""" """
...@@ -93,7 +93,7 @@ class Reports(PublicationsTool): ...@@ -93,7 +93,7 @@ class Reports(PublicationsTool):
@param record: @param record:
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException from invenio_tools import CheckException
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID from plugin_dbui import get_id, UNDEF_ID
class Talks(PublicationsTool): class Talks(Automaton):
"""Publications tool for conference talks. """Publications tool for conference talks.
""" """
...@@ -86,7 +86,7 @@ class Talks(PublicationsTool): ...@@ -86,7 +86,7 @@ class Talks(PublicationsTool):
@rtype: bool @rtype: bool
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
if self.dbg: if self.dbg:
......
...@@ -6,16 +6,16 @@ import re ...@@ -6,16 +6,16 @@ import re
import traceback import traceback
from automaton import Automaton
from base import family_name_fr, MSG_CRASH, MSG_LOAD from base import family_name_fr, MSG_CRASH, MSG_LOAD
from invenio_tools import CheckException, RecordThesis from invenio_tools import CheckException, RecordThesis
from publicationstool import PublicationsTool
from plugin_dbui import get_id, UNDEF_ID from plugin_dbui import get_id, UNDEF_ID
MSG_NO_THESIS = "Reject not a thesis record" MSG_NO_THESIS = "Reject not a thesis record"
class Thesis(PublicationsTool): class Thesis(Automaton):
"""Publications tool for thesis. """Publications tool for thesis.
""" """
...@@ -84,7 +84,7 @@ class Thesis(PublicationsTool): ...@@ -84,7 +84,7 @@ class Thesis(PublicationsTool):
@param record: @param record:
""" """
if not PublicationsTool.select_record(self, record): if not Automaton.select_record(self, record):
return False return False
try: try:
......
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