new build. added logging.
[comic-widget] / src / usr / lib / hildon-desktop / comicwidget.py
index 303b620..1a05759 100644 (file)
@@ -18,8 +18,14 @@ socket.setdefaulttimeout(30)
 supports_alpha = False
 
 # LOGGING!
-# sys.stdout = open('/home/user/.comic-widget/output_log.txt', 'a', 0)
-# sys.stderr = open('/home/user/.comic-widget/error_log.txt', 'a', 0)
+if not os.path.exists("/home/user/.comic-widget/"):
+       print "path not found: /home/user/.comic-widget/"
+       try:
+               os.makedirs("/home/user/.comic-widget/")
+       except:
+               print "logging failed on mkdir"
+sys.stdout = open('/home/user/.comic-widget/output_log.txt', 'a', 0)
+sys.stderr = open('/home/user/.comic-widget/error_log.txt', 'a', 0)
 # print "Start logging!"
 
 # constants. dbfile is the location of the csv