Esempio n. 1
0
    def _check_schema_migration(self):
        from stoqlib.lib.message import error
        from stoqlib.database.migration import needs_schema_update
        from stoqlib.exceptions import DatabaseInconsistency
        if needs_schema_update():
            self._run_update_wizard()

        from stoqlib.database.migration import StoqlibSchemaMigration
        migration = StoqlibSchemaMigration()
        try:
            migration.check()
        except DatabaseInconsistency as e:
            error(_('The database version differs from your installed '
                    'version.'), str(e))
Esempio n. 2
0
    def load_config_and_call_setup(self):
        dbargs = self.settings.get_command_line_arguments()
        parser = get_option_parser()
        db_options, unused_args = parser.parse_args(dbargs)
        self.config.set_from_options(db_options)

        if needs_schema_update():
            retval = run_dialog(SchemaUpdateWizard, None)
            if not retval:
                raise SystemExit()

        try:
            setup(self.config,
                  options=self.options,
                  check_schema=True,
                  register_station=False,
                  load_plugins=False)
        except DatabaseInconsistency as err:
            error(_('The database version differs from your installed '
                    'version.'), str(err))
Esempio n. 3
0
    def load_config_and_call_setup(self):
        dbargs = self.settings.get_command_line_arguments()
        parser = get_option_parser()
        db_options, unused_args = parser.parse_args(dbargs)
        self.config.set_from_options(db_options)

        if needs_schema_update():
            retval = run_dialog(SchemaUpdateWizard, None)
            if not retval:
                raise SystemExit()

        try:
            setup(self.config,
                  options=self.options,
                  check_schema=True,
                  register_station=False,
                  load_plugins=False)
        except DatabaseInconsistency as err:
            error(_('The database version differs from your installed '
                    'version.'), str(err))