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