Fix bug when running command line reports

svn: r20523
This commit is contained in:
Nick Hall 2012-10-04 23:16:50 +00:00
parent 5ac9aaa3f4
commit c8baa0fcb6

View File

@ -146,25 +146,26 @@ class CLIDbLoader(object):
mode = 'w' mode = 'w'
dbclass = DbBsddb dbclass = DbBsddb
dbclass.disable_signals()
self.dbstate.change_database(dbclass())
self.dbstate.db.disable_signals()
self._begin_progress() self._begin_progress()
try: try:
dbclass.load(filename, self._pulse_progress, mode) self.dbstate.db.load(filename, self._pulse_progress, mode)
dbclass.set_save_path(filename) self.dbstate.db.set_save_path(filename)
self.dbstate.change_database(dbclass()) except gen.db.exceptions.DbUpgradeRequiredError, msg:
except DbUpgradeRequiredError, msg:
self.dbstate.no_database() self.dbstate.no_database()
self._errordialog( _("Cannot open database"), str(msg)) self._errordialog( _("Cannot open database"), str(msg))
except DbVersionError, msg: except gen.db.exceptions.DbVersionError, msg:
self.dbstate.no_database() self.dbstate.no_database()
self._errordialog( _("Cannot open database"), str(msg)) self._errordialog( _("Cannot open database"), str(msg))
except OSError, msg: except OSError, msg:
self.dbstate.no_database() self.dbstate.no_database()
self._errordialog( self._errordialog(
_("Could not open file: %s") % filename, str(msg)) _("Could not open file: %s") % filename, str(msg))
except DbError, msg: except Errors.DbError, msg:
self.dbstate.no_database() self.dbstate.no_database()
self._dberrordialog(msg) self._dberrordialog(msg)
except Exception: except Exception: