Skip to content
Snippets Groups Projects
gajim.py 1.99 KiB
Newer Older
Yann Leboulanger's avatar
Yann Leboulanger committed
##	common/gajim.py
##
## Gajim Team:
nkour's avatar
nkour committed
## - Yann Le Boulanger <asterix@lagaule.org>
## - Vincent Hanquez <tab@snarc.org>
## - Nikos Kouremenos <kourem@gmail.com>
Yann Leboulanger's avatar
Yann Leboulanger committed
##
##	Copyright (C) 2003-2005 Gajim Team
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; version 2 only.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##

Yann Leboulanger's avatar
Yann Leboulanger committed
import logging
import common.config
import common.logger
Yann Leboulanger's avatar
Yann Leboulanger committed

nkour's avatar
nkour committed
version = '0.8'
Yann Leboulanger's avatar
Yann Leboulanger committed
config = common.config.Config()
connections = {}

h = logging.StreamHandler()
f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S')
h.setFormatter(f)
Yann Leboulanger's avatar
Yann Leboulanger committed
log = logging.getLogger('Gajim')
log.addHandler(h)

logger = common.logger.Logger()
DATA_DIR = '../data'
nkour's avatar
nkour committed
LANG = os.getenv('LANG') # en_US, fr_FR, el_GR etc..
if LANG:
nkour's avatar
nkour committed
	LANG = LANG[:2] # en, fr, el etc..
else:
	LANG = 'en'
last_message_time = {} # list of time of the latest incomming message
							# {acct1: {jid1: time1, jid2: time2}, }
encrypted_chats = {} # list of encrypted chats {acct1: [jid1, jid2], ..}

contacts = {} # list of contacts {acct: {jid1: [C1, C2]}, } one Contact per resource
groups = {} # list of groups
newly_added = {} # list of contacts that has just signed in
to_be_removed = {} # list of contacts that has just signed out
awaiting_messages = {} # list of messages reveived but not printed
nicks = {} # list of our nick names in each account
allow_notifications = {} # do we allow notifications for each account ?
con_types = {} # type of each connection (ssl, tls, tcp, ...)

sleeper_state = {} # whether we pass auto away / xa or not
#'off': don't use sleeper for this account
#'online': online and use sleeper
#'autoaway': autoaway and use sleeper
#'autoxa': autoxa and use sleeper