From 42d4aa2ab4ebcbb805835a6a1b73a65ec16d365b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 3 Jan 2017 23:08:32 +0100 Subject: [PATCH] Test required version of all GTK libs at start --- src/gajim.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index ac6e52f47..983dfea72 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -51,8 +51,18 @@ if os.name == 'nt': warnings.filterwarnings(action='ignore') +# Test here for all required versions so we dont have to +# test multiple times in every module. nbxmpp also needs GLib. +import gi +gi.require_version('GLib', '2.0') +gi.require_version('Gio', '2.0') +gi.require_version('Gtk', '3.0') +gi.require_version('Gdk', '3.0') +gi.require_version('GObject', '2.0') +gi.require_version('Pango', '1.0') + MIN_NBXMPP_VER = "0.5.3" -from gi.repository import GLib + try: import nbxmpp except ImportError: @@ -100,12 +110,6 @@ 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', '3.0') -gi.require_version('GObject', '2.0') -gi.require_version('Pango', '1.0') - import getopt from common import i18n