def proceed(): ''' check db schema, and proceed if all is well ''' # this import will set up gettext and logging from openmolar.dbtools import schema_version LOGGER.debug("checking schema version...") sv = schema_version.getVersion() run_main = False if IGNORE_SCHEMA_CHECK or localsettings.CLIENT_SCHEMA_VERSION == sv: run_main = True elif localsettings.CLIENT_SCHEMA_VERSION > sv: print "schema is out of date" from openmolar.qt4gui import schema_updater sys.exit(schema_updater.main()) elif localsettings.CLIENT_SCHEMA_VERSION < sv: print "client is out of date....." compatible = schema_version.clientCompatibility( localsettings.CLIENT_SCHEMA_VERSION) if not compatible: QtGui.QMessageBox.warning(None, _("Update Client"), _('''<p>Sorry, you cannot run this version of the openMolar client because your database schema is more advanced.</p> <p>this client requires schema version %s, but your database is at %s</p> <p>Please Update openMolar now</p>''') % ( localsettings.CLIENT_SCHEMA_VERSION, sv)) else: result = QtGui.QMessageBox.question(None, _("Proceed without upgrade?"), _('''<p>This openMolar client has fallen behind your database schema version<br />this client was written for schema version %s, but your database is now at %s<br />However, the differences are not critical, and you can continue if you wish</p> <p><i>It would still be wise to update this client ASAP</i></p> <hr /><p>Do you wish to continue?</p>''') % ( localsettings.CLIENT_SCHEMA_VERSION, sv), QtGui.QMessageBox.No | QtGui.QMessageBox.Yes, QtGui.QMessageBox.Yes) if result == QtGui.QMessageBox.Yes: run_main = True if run_main: from openmolar.qt4gui import maingui maingui.main(my_app) else: sys.exit()
def proceed(): ''' check db schema, and proceed if all is well ''' # this import will set up gettext and logging from openmolar.dbtools import schema_version LOGGER.debug("checking schema version...") sv = schema_version.getVersion() run_main = False if IGNORE_SCHEMA_CHECK or localsettings.CLIENT_SCHEMA_VERSION == sv: run_main = True elif localsettings.CLIENT_SCHEMA_VERSION > sv: print "schema is out of date" from openmolar.qt4gui import schema_updater sys.exit(schema_updater.main()) elif localsettings.CLIENT_SCHEMA_VERSION < sv: print "client is out of date....." compatible = schema_version.clientCompatibility( localsettings.CLIENT_SCHEMA_VERSION) if not compatible: QtGui.QMessageBox.warning(None, _("Update Client"), _('''<p>Sorry, you cannot run this version of the openMolar client because your database schema is more advanced.</p> <p>this client requires schema version %s, but your database is at %s</p> <p>Please Update openMolar now</p>''')% ( localsettings.CLIENT_SCHEMA_VERSION, sv)) else: result = QtGui.QMessageBox.question(None, _("Proceed without upgrade?"), _('''<p>This openMolar client has fallen behind your database schema version<br />this client was written for schema version %s, but your database is now at %s<br />However, the differences are not critical, and you can continue if you wish</p> <p><i>It would still be wise to update this client ASAP</i></p> <hr /><p>Do you wish to continue?</p>''')% ( localsettings.CLIENT_SCHEMA_VERSION, sv), QtGui.QMessageBox.No | QtGui.QMessageBox.Yes, QtGui.QMessageBox.Yes ) if result == QtGui.QMessageBox.Yes: run_main = True if run_main: from openmolar.qt4gui import maingui maingui.main(my_app) else: sys.exit()
def proceed(): ''' on to the main gui. ''' from openmolar.qt4gui import maingui localsettings.loadFeeTables() sys.exit(maingui.main(QtGui.QApplication.instance()))
def main(): ''' main function ''' from openmolar.qt4gui import maingui maingui.main()