From 68ad749f6aad106b6f0ef78d99cafd5418d817ca Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Fri, 14 Mar 2008 04:26:44 +0000 Subject: [PATCH] 0001908: BUG: running tools from command line svn: r10303 --- src/PluginUtils/_Tool.py | 1 + src/plugins/Rebuild.py | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/PluginUtils/_Tool.py b/src/PluginUtils/_Tool.py index 300eee086..8fa103234 100644 --- a/src/PluginUtils/_Tool.py +++ b/src/PluginUtils/_Tool.py @@ -161,6 +161,7 @@ class CommandLineTool: self.database = database self.category = category self.option_class = option_class(name) + self.option_class.load_previous_values() self.show = options_str_dict.pop('show',None) self.options_str_dict = options_str_dict self.init_options(noopt) diff --git a/src/plugins/Rebuild.py b/src/plugins/Rebuild.py index 2be016040..62d2eb526 100644 --- a/src/plugins/Rebuild.py +++ b/src/plugins/Rebuild.py @@ -67,28 +67,27 @@ class Rebuild(Tool.Tool,UpdateCallback): return self.db.disable_signals() + if uistate: self.callback = uistate.pulse_progressbar uistate.set_busy_cursor(1) uistate.progress.show() uistate.push_message(dbstate, _("Rebuilding secondary indices...")) - else: - print "Rebuilding Secondary Indices..." - self.db.rebuild_secondary(self.empty) - print "All secondary indices have been rebuilt." - - UpdateCallback.__init__(self,self.callback) - self.set_total(11) - self.db.rebuild_secondary(self.update) - self.reset() - - if uistate: + + UpdateCallback.__init__(self,self.callback) + self.set_total(11) + self.db.rebuild_secondary(self.update) + self.reset() + uistate.set_busy_cursor(0) uistate.progress.hide() OkDialog(_("Secondary indices rebuilt"), _('All secondary indices have been rebuilt.')) else: + print "Rebuilding Secondary Indices..." + self.db.rebuild_secondary(self.update_empty) print "All secondary indices have been rebuilt." + self.db.enable_signals() #------------------------------------------------------------------------