Commit 53eb9528 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the mode dry_run to all harvester wizards.

parent 0dc9c81e
......@@ -56,7 +56,7 @@ def insert_marcxml():
"""
try:
selector = Selector(virtdb.marc12_selector)
selector = Selector(virtdb.marc12_selector, exclude_fields=('mode'))
tool_class = get_harvester_tool(selector.controller)
if not tool_class:
......@@ -93,7 +93,7 @@ def run():
"""
try:
selector = Selector(virtdb.harvester_selector,
exclude_fields=('year_start', 'year_end'))
exclude_fields=('mode', 'year_start', 'year_end'))
tool_class = get_harvester_tool(selector.controller)
if not tool_class:
......@@ -127,7 +127,7 @@ def run_all():
try:
selector = Selector(virtdb.run_all_harvesters_selector,
exclude_fields=('year_start', 'year_end'))
exclude_fields=('mode', 'year_start', 'year_end'))
for row in db().select(db.harvesters.ALL):
......
......@@ -13,7 +13,7 @@
'Affiliation': 'Affiliation',
'Agencies': 'Agencies',
'All fields of the form have to be defined !!!': 'Tous les champs doivent ếtre définis !!!',
'Already in the database': 'Already in the database',
'Already in the database': 'Publication déjà enregistré dans la base de donnée',
'AP': 'AP',
'Are you sure you want to delete this object?': 'Voulez-vous vraiment détruire cet object ?',
'Articles': 'Articles',
......@@ -182,8 +182,8 @@
'List of sections separated by a comma: Articles, Proceedings.': 'List of sections separated by a comma: Articles, Proceedings.',
'lists': 'listes',
'Load': 'Load',
'load in the database': 'charger la base de données',
'Load in the database': 'Charger la base de données',
'load in the database': 'charger dans la base de données',
'Load in the database': 'Charger dans la base de données',
'Logged in': 'Logged in',
'Logged out': 'Logged out',
'Login': 'Login',
......
......@@ -91,7 +91,8 @@ virtdb.define_table('harvester_selector',
Field('year_end', 'integer'),
Field('id_teams', db.teams, label='Team'),
Field('id_projects', db.projects, label='Project'),
Field('controller', 'string', label='Harvest'))
Field('controller', 'string', label='Harvest'),
Field("mode", "string", default=MODE_LOAD_IN_DB))
virtdb.harvester_selector.id_projects.requires = \
IS_IN_DB(db, 'projects.id', 'projects.project')
......@@ -99,6 +100,9 @@ IS_IN_DB(db, 'projects.id', 'projects.project')
virtdb.harvester_selector.id_teams.requires = \
IS_IN_DB(db, 'teams.id', 'teams.team')
virtdb.harvester_selector.mode.requires = \
IS_IN_SET([MODE_DRY_RUN, MODE_LOAD_IN_DB])
#
# list selector
#
......@@ -133,11 +137,9 @@ virtdb.define_table('marc12_selector',
Field('id_projects', db.projects, label='Project'),
Field('xml', 'text', comment=tp_xml, label='MARCXML'),
Field('controller', 'string', label='Process as'),
Field('id_categories', db.categories, label='Category'))
Field('id_categories', db.categories, label='Category'),
Field("mode", "string", default=MODE_DRY_RUN))
virtdb.marc12_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.id', 'categories.code')
virtdb.marc12_selector.controller.requires = IS_IN_SET(['articles',
'notes',
......@@ -147,12 +149,18 @@ virtdb.marc12_selector.controller.requires = IS_IN_SET(['articles',
'talks',
'theses'])
virtdb.marc12_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.id', 'categories.code')
virtdb.marc12_selector.id_projects.requires = \
IS_IN_DB(db, 'projects.id', 'projects.project')
virtdb.marc12_selector.id_teams.requires = \
IS_IN_DB(db, 'teams.id', 'teams.team')
virtdb.marc12_selector.mode.requires = \
IS_IN_SET([MODE_DRY_RUN, MODE_LOAD_IN_DB])
virtdb.marc12_selector.xml.requires = IS_MATCH('<\?xml*')
#
......@@ -182,4 +190,8 @@ virtdb.metric_selector.format.requires = IS_IN_SET(['html', 'csv'])
#
virtdb.define_table('run_all_harvesters_selector',
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'))
Field('year_end', 'integer'),
Field("mode", "string", default=MODE_LOAD_IN_DB))
virtdb.run_all_harvesters_selector.mode.requires = \
IS_IN_SET([MODE_DRY_RUN, MODE_LOAD_IN_DB])
......@@ -10,6 +10,7 @@ HEAD
- Add a wizard to check and validate records
- Add a wizard to run all harvesters in one go.
- Add a wizard to run a free harvester.
- Add the mode dry run for all harvester wiazrds.
0.6.0 (Oct 2012)
- Redesign the metric to use the axes approach.
......
......@@ -47,4 +47,4 @@
It almost work but the values are wrong at the first call.
A fix can be to remove default values defined in the form model.
0.6.0-52-g3197a72 (Nov 2012)
0.6.0-55-g3197a72 (Nov 2012)
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