Commit 199d216f authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix typos discover running harvester

parent aa2c3bed
......@@ -9,20 +9,20 @@ from gluon import current
from gluon.restricted import RestrictedError
from harvest_tools import (build_harvester_tool,
CheckAndFix,
CheckException,
DRY_RUN,
MsgCollection,
search_synonym,
ToolException)
MsgCollection)
from plugin_dbui import (inline_alert,
Selector,
to_formPanel,
UNDEF_ID)
from requests.exceptions import RequestException
from store_tools import (load_record,
from store_tools import (CheckException,
load_record,
OAI_URL,
RecordCdsConfPaper,
RecordCdsThesis)
RecordCdsThesis,
search_synonym,
ToolException)
MODE_DRY_RUN = T(DRY_RUN)
MSG_GREMLIN = "Oops a gremlin..."
......
......@@ -65,8 +65,9 @@ class Articles(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -131,7 +131,7 @@ class Automaton(object):
self.id_project = id_project
self.logs = []
self.logger = logging.getLogger("web2py.app.limbra")
self.rex_intitute = get_rex_institute(db, current.app)
self.rex_institute = get_rex_institute(db, current.app)
self.store = None
self.year_start = year_start
self.year_end = year_end
......
......@@ -138,6 +138,6 @@ def get_rex_institute(db, app):
lst.append(val)
reg_institute = r"|".join(lst)
app.reg_institute = reg_institute = r"|".join(lst)
return reg_institute
......@@ -45,8 +45,9 @@ class Notes(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -69,8 +69,9 @@ class Preprints(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -51,8 +51,9 @@ class Proceedings(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -45,8 +45,9 @@ class Reports(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -50,8 +50,9 @@ class Talks(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -42,8 +42,9 @@ class Thesis(Automaton):
# format authors according to my format
# extract authors form my institute signing the publication
# is submitted date well formed
record.check_and_fix(self.rex_institute,
record.check_and_fix(db=self.db,
fmt_author="F. Last",
rex_institute=self.rex_institute,
sep_author=", ",
sort_author=True)
......
......@@ -555,12 +555,12 @@ class RecordCdsPubli(dict, AuthorsMixin, PublicationInfoMixin):
else:
self["prepublication"] = {"date": date}
def check_and_fix_record(self,
db=None,
fmt_author=None,
rex_institute=None,
sep_author=", ",
sort_author=False):
def check_and_fix(self,
db=None,
fmt_author=None,
rex_institute=None,
sep_author=", ",
sort_author=False):
"""Check record and fix non-conformities.
* is with authors
......
......@@ -10,7 +10,7 @@ from .base import (search_synonym,
MSG_WELL_FORMED_DATE,
REG_DATE_YYYYMM,
T4, T6)
from .exception import CheckException
from .exception import CheckException, ToolException
from filters import CLEAN_COLLABORATION
from pandas import DataFrame
from .publicationinfomixin import PublicationInfoMixin
......@@ -237,13 +237,17 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
if len(val) == 0:
return
dbid = search_synonym(db.collaborations, "collaboration", val)
if dbid == UNDEF_ID:
raise CheckException(MSG_UNKNOWN_COLLABORATION)
try:
dbid = search_synonym(db.collaborations, "collaboration", val)
if dbid == UNDEF_ID:
raise CheckException(MSG_UNKNOWN_COLLABORATION)
collaboration = db.collaborations[dbid].collaboration
if collaboration != val:
self["collaborations"] = [{"value": collaboration}]
collaboration = db.collaborations[dbid].collaboration
if collaboration != val:
self["collaborations"] = [{"value": collaboration}]
except ToolException as e:
raise CheckException(e)
def check_my_affiliation(self, rex_institute=None):
"""Check that authors of my institute are signatories.
......@@ -285,12 +289,12 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
if not REG_DATE_YYYYMM.match(xdate):
raise CheckException(MSG_WELL_FORMED_DATE)
def check_and_fix_record(self,
db=None,
fmt_author=None,
rex_institute=None,
sep_author=", ",
sort_author=False):
def check_and_fix(self,
db=None,
fmt_author=None,
rex_institute=None,
sep_author=", ",
sort_author=False):
"""Check record and fix non-conformities.
* is with authors
......
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