This commit is contained in:
Nikos Kouremenos 2005-05-12 17:17:20 +00:00
parent c4dfadff09
commit 00cd5dd0dc
1 changed files with 9 additions and 4 deletions

View File

@ -22,9 +22,15 @@ import sys
import time
import common.gajim
from common import i18n
LOGPATH = os.path.expanduser('~/.gajim/logs')
_ = i18n._
LOGPATH = os.path.expanduser('~/.gajim/logs')
if os.name == 'nt':
try:
LOGPATH = os.environ['appdata']
except KeyError:
pass
class Logger:
def __init__(self):
dot_gajim = os.path.expanduser('~/.gajim')
@ -37,13 +43,12 @@ class Logger:
print '~/.gajim/logs is file but it should be a directory'
print 'Gajim will now exit'
sys.exit()
else: #create ~/.gajim/logs/ if it doesn't exist
os.mkdir(os.path.expanduser('~/.gajim'))
else: #create ~/.gajim/logs if it doesn't exist
os.mkdir(dot_gajim)
print 'creating ~/.gajim directory'
os.mkdir(LOGPATH)
print 'creating ~/.gajim/logs directory'
def write(self, kind, msg, jid, show = None, tim = None):
if not tim:
tim = time.time()