From 5c0fce96680c1a6cd3c398bda118ecc6ab5cdd3b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 30 Jul 2015 15:15:38 +0200 Subject: [PATCH] fix launch when optional modules are not installed --- src/common/gajim.py | 2 +- src/common/passwords.py | 2 +- src/gajim.py | 10 +++++----- src/notify.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/gajim.py b/src/common/gajim.py index a40a26a8b..1161cceae 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -211,7 +211,7 @@ try: gi.require_version('GUPnPIgd', '1.0') from gi.repository import GUPnPIgd gupnp_igd = GUPnPIgd.SimpleIgd() -except ImportError: +except ValueError: HAVE_UPNP_IGD = False HAVE_PYCURL = True diff --git a/src/common/passwords.py b/src/common/passwords.py index 708ef06f7..ccff38c9f 100644 --- a/src/common/passwords.py +++ b/src/common/passwords.py @@ -258,7 +258,7 @@ def get_storage(): gir = __import__('gi.repository', globals(), locals(), ['Secret'], 0) Secret = gir.Secret - except (ImportError, AttributeError): + except (ValueError, AttributeError): global GnomeKeyring try: gir = __import__('gi.repository', globals(), locals(), diff --git a/src/gajim.py b/src/gajim.py index 38183058f..b9b9e57ef 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -134,11 +134,11 @@ import logging # gajim.gui or gajim.gtk more appropriate ? log = logging.getLogger('gajim.gajim') -#import gi -#gi.require_version('Gtk', '3.0') -#gi.require_version('Gdk', '2.0') -#gi.require_version('GObject', '2.0') -#gi.require_version('Pango', '1.0') +import gi +gi.require_version('Gtk', '3.0') +gi.require_version('Gdk', '3.0') +gi.require_version('GObject', '2.0') +gi.require_version('Pango', '1.0') import getopt from common import i18n diff --git a/src/notify.py b/src/notify.py index bdb0f907f..8a50565a9 100644 --- a/src/notify.py +++ b/src/notify.py @@ -50,7 +50,7 @@ try: gi.require_version('Notify', '0.7') from gi.repository import Notify Notify.init('Gajim Notification') -except ImportError: +except ValueError: USER_HAS_PYNOTIFY = False def get_show_in_roster(event, account, contact, session=None):