Updating from Dialcentral/ejpi
[quicknote] / src / quicknote.py
index 0848b53..9410944 100755 (executable)
@@ -8,17 +8,30 @@ it under the terms of the GNU General Public License version 2 as
 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("quicknote")
 gettext.install('quicknote', unicode = 1)
+sys.path.append('/usr/lib/quicknote')
+
 
+import constants
 import libquicknote
 
 
 if __name__ == "__main__":
+       try:
+               os.makedirs(constants._data_path_)
+       except OSError, e:
+               if e.errno != 17:
+                       raise
+
+       userLogPath = "%s/quicknote.log" % constants._data_path_
+       logging.basicConfig(level=logging.DEBUG, filename=userLogPath)
+       _moduleLogger.info("quicknote %s-%s" % (constants.__version__, constants.__build__))
+
        app = libquicknote.QuicknoteProgram()
        app.main()