Fixing a bug with launching from a fresh system
[quicknote] / src / quicknote.py
index c471891..1dcc853 100755 (executable)
@@ -10,14 +10,29 @@ published by the Free Software Foundation.
 
 import os
 import sys
-sys.path.append('/usr/lib/quicknote')
-
-import locale
+import logging
 import gettext
+
+_moduleLogger = logging.getLogger(__name__)
 gettext.install('quicknote', unicode = 1)
+sys.path.append('/usr/lib/quicknote')
+
+
+import constants
+import quicknote_gtk
 
-import libquicknote
 
 if __name__ == "__main__":
-       app = libquicknote.quicknoteclass()
-       app.main()
+       try:
+               os.makedirs(constants._data_path_)
+       except OSError, e:
+               if e.errno != 17:
+                       raise
+
+       logging.basicConfig(level=logging.DEBUG, filename=constants._user_logpath_)
+       _moduleLogger.info("quicknote %s-%s" % (constants.__version__, constants.__build__))
+       _moduleLogger.info("OS: %s" % (os.uname()[0], ))
+       _moduleLogger.info("Kernel: %s (%s) for %s" % os.uname()[2:])
+       _moduleLogger.info("Hostname: %s" % os.uname()[1])
+
+       quicknote_gtk.run_quicknote()