0001908: BUG: running tools from command line

svn: r10302
This commit is contained in:
Brian Matherly 2008-03-14 04:25:30 +00:00
parent 961b06d57b
commit 1a9067e7de
2 changed files with 11 additions and 11 deletions

View File

@ -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)

View File

@ -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:
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()
#------------------------------------------------------------------------