Commit 2ea30b3d authored by Philipp Hörist's avatar Philipp Hörist

Move nbxmpp import test into do_startup

parent 4bf65a40
......@@ -37,6 +37,8 @@ except ImportError:
logging_helpers.init(sys.stderr.isatty())
log = logging.getLogger('gajim.gajim')
MIN_NBXMPP_VER = "0.5.3"
class GajimApplication(Gtk.Application):
'''Main class handling activation and command line.'''
......@@ -85,6 +87,18 @@ class GajimApplication(Gtk.Application):
import gtkexcepthook
gtkexcepthook.init()
try:
import nbxmpp
except ImportError:
print('Gajim needs python-nbxmpp to run. Quitting…')
sys.exit(1)
from distutils.version import LooseVersion as V
if V(nbxmpp.__version__) < V(MIN_NBXMPP_VER):
print('Gajim needs python-nbxmpp >= %s to run. '
'Quitting…' % MIN_NBXMPP_VER)
sys.exit(1)
# Create and initialize Application Paths & Databases
import common.configpaths
common.configpaths.gajimpaths.init(
......
......@@ -47,19 +47,6 @@ gi.require_version('Gdk', '3.0')
gi.require_version('GObject', '2.0')
gi.require_version('Pango', '1.0')
MIN_NBXMPP_VER = "0.5.3"
try:
import nbxmpp
except ImportError:
print('Gajim needs python-nbxmpp to run. Quiting…')
sys.exit(1)
from distutils.version import LooseVersion as V
if V(nbxmpp.__version__) < V(MIN_NBXMPP_VER):
print('Gajim needs python-nbxmpp >= %s to run. Quiting…' % MIN_NBXMPP_VER)
sys.exit(1)
from application import GajimApplication
app = GajimApplication()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment