###################################################################### # Copyright (c) 2007, Petteri Aimonen # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice and this list of conditions. # * Redistributions in binary form must reproduce the above copyright # notice and this list of conditions in the documentation and/or other # materials provided with the distribution. '''Main program.''' import wx import sys import datetime from version import version class MyApp(wx.App): def OnInit(self): print print "Started", datetime.datetime.today().isoformat() import settings import pymisc from guiconfig import do_guiconfig pymisc.translator.setlanguage(settings.parser.get("GUI", "language")) if settings.newfile: do_guiconfig() from mainwindow import MainWindow from guiimport import do_guiimport do_guiimport() w = MainWindow() w.Show() self.SetTopWindow(w) return True def main(): try: app = MyApp(filename = 'error.log') app.MainLoop() finally: from database import db_conn import settings db_conn.commit() settings.saveconfig()