Adds log file existence checking on program startup

This commit is contained in:
2012-08-31 12:21:24 +02:00
parent 2ef9c107d7
commit a52c098d59
2 changed files with 12 additions and 1 deletions

View File

@@ -1,8 +1,19 @@
#!/usr/bin/env python
import wx
import os
from ivolution.gui import IvolutionWindow
# Trying to create personal folder if needed
dir = os.path.join(os.path.expanduser("~"), ".ivolution")
if not os.path.exists(dir):
os.makedirs(dir)
# Trying to create log file if needed
myfile = os.path.join(dir, 'ivolution.log')
if not os.path.isfile(myfile):
file(myfile, 'w').close()
app = wx.App(False)
frame = IvolutionWindow.IvolutionWindow(None, "Ivolution Window")
app.MainLoop() # Runs application

View File

@@ -256,7 +256,7 @@ either expressed or implied, of the FreeBSD Project."""
Start logging in file here
"""
personal_dir = os.path.join(self.home_dir, ".ivolution")
log_root = 'fm.log'
log_root = 'ivolution.log'
log_file = os.path.join(os.path.expanduser(personal_dir), log_root)
# create logger for 'facemovie'