From 9fcb9f1d7042f9eb3679f46444c6a29f6ea03dd0 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 17 May 2005 20:31:43 +0000 Subject: [PATCH] no need of global things in systray.py --- src/common/gajim.py | 7 +++++++ src/systray.py | 14 +++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/common/gajim.py b/src/common/gajim.py index bf4faf4c4..dcc8fd7c8 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -24,6 +24,13 @@ import common.logger version = '0.7' 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) log = logging.getLogger('Gajim') +log.addHandler(h) +log.setLevel(logging.DEBUG) + logger = common.logger.Logger() DATA_DIR = '../data' diff --git a/src/systray.py b/src/systray.py index a7502e8c0..64ee69220 100644 --- a/src/systray.py +++ b/src/systray.py @@ -24,6 +24,15 @@ import dialogs from common import gajim from common import i18n +try: + import egg.trayicon as trayicon # gnomepythonextras trayicon +except: + try: + import trayicon # our trayicon + except: + gajim.log.debug('No trayicon module available') + pass + _ = i18n._ APP = i18n.APP gtk.glade.bindtextdomain(APP, i18n.DIR) @@ -261,8 +270,3 @@ class Systray: self.xml = gtk.glade.XML(GTKGUI_GLADE, 'systray_context_menu', APP) self.systray_context_menu = self.xml.get_widget('systray_context_menu') self.xml.signal_autoconnect(self) - global trayicon - try: - import egg.trayicon as trayicon # gnomepythonextras trayicon - except: - import trayicon # our trayicon