create AppData/Gajim folder if it doesn't exists

This commit is contained in:
Yann Leboulanger 2010-10-27 09:37:56 +02:00
parent ab2ddc4935
commit 2fa280acbb
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,10 @@ if os.name == 'nt':
import warnings import warnings
if os.name == 'nt': if os.name == 'nt':
log_file = os.path.join(os.environ['APPDATA'], 'Gajim', 'gajim.log') log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
if not os.path.exists(log_path):
os.mkdir(log_path, 0700)
log_file = os.path.join(log_path, 'gajim.log')
fout = open(log_file, 'a') fout = open(log_file, 'a')
sys.stdout = fout sys.stdout = fout
sys.stderr = fout sys.stderr = fout