mirror of
https://github.com/jlengrand/Ivolution.git
synced 2026-03-10 08:21:18 +00:00
Adds log file existence checking on program startup
This commit is contained in:
11
Ivolutioner
11
Ivolutioner
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user