Commit 2bbde0ef authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Minor improvement in harvester controllers, translate on demand.

parent d9ff1993
......@@ -25,8 +25,8 @@ from plugin_dbui import (get_id,
UNDEF_ID)
MODE_DRY_RUN = T(DRY_RUN)
MSG_NO_REG_INSTITUTE = T("Preference REG_INSTITUTE is not defined.")
MSG_NO_HARVESTER = T("No harvesters for your selection !!!")
MSG_NO_REG_INSTITUTE = "Preference REG_INSTITUTE is not defined."
MSG_NO_HARVESTER = "No harvesters for your selection !!!"
MSG_NO_RECORD = "Sorry, the record does not exist."
def free_run():
......@@ -35,7 +35,7 @@ def free_run():
"""
if not current.app.inspirehep_institute_id:
return INLINE_ALERT % (T("Error"), MSG_NO_REG_INSTITUTE)
return INLINE_ALERT % (T("Error"), T(MSG_NO_REG_INSTITUTE))
table = virtdb.free_harvester_selector
fields = ('collections',
......@@ -95,7 +95,7 @@ def edit_insert():
"""
if not current.app.inspirehep_institute_id:
return INLINE_ALERT % (T("Error"), MSG_NO_REG_INSTITUTE)
return INLINE_ALERT % (T("Error"), T(MSG_NO_REG_INSTITUTE))
fields = ('controller',
'host',
......@@ -269,7 +269,7 @@ def insert_marcxml():
"""
if not current.app.inspirehep_institute_id:
return INLINE_ALERT % (T("Error"), MSG_NO_REG_INSTITUTE)
return INLINE_ALERT % (T("Error"), T(MSG_NO_REG_INSTITUTE))
try:
selector = Selector(virtdb.marc12_selector, exclude_fields=('mode'))
......@@ -317,7 +317,7 @@ def run():
"""
if not current.app.inspirehep_institute_id:
return INLINE_ALERT % (T("Error"), MSG_NO_REG_INSTITUTE)
return INLINE_ALERT % (T("Error"), T(MSG_NO_REG_INSTITUTE))
try:
selector = Selector(virtdb.harvester_selector,
......@@ -326,7 +326,7 @@ def run():
# Get hosts and collections
rows = selector.select(db.harvesters)
if not rows:
raise ToolException(MSG_NO_HARVESTER)
raise ToolException(T(MSG_NO_HARVESTER))
collection_logs = []
logs = []
......@@ -371,7 +371,7 @@ def run_all():
"""
if not current.app.inspirehep_institute_id:
return INLINE_ALERT % (T("Error"), MSG_NO_REG_INSTITUTE)
return INLINE_ALERT % (T("Error"), T(MSG_NO_REG_INSTITUTE))
collection_logs = []
logs = []
......@@ -391,7 +391,7 @@ def run_all():
harvesters = db(query).select(db.harvesters.ALL)
if not len(harvesters):
return INLINE_ALERT % (T('Error'), MSG_NO_HARVESTER)
return INLINE_ALERT % (T('Error'), T(MSG_NO_HARVESTER))
for harvester in harvesters:
......
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