Move gobject check from __init__ to __main__

Related to #1068
This commit is contained in:
Stein Magnus Jodal 2015-04-07 01:05:45 +02:00
parent df1636e814
commit 20b457cc4a
2 changed files with 16 additions and 17 deletions

View File

@ -2,7 +2,6 @@ from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import textwrap
import warnings
@ -11,21 +10,6 @@ if not (2, 7) <= sys.version_info < (3,):
'ERROR: Mopidy requires Python 2.7, but found %s.' %
platform.python_version())
try:
import gobject # noqa
except ImportError:
print(textwrap.dedent("""
ERROR: The gobject Python package was not found.
Mopidy requires GStreamer (and GObject) to work. These are C libraries
with a number of dependencies themselves, and cannot be installed with
the regular Python tools like pip.
Please see http://docs.mopidy.com/en/latest/installation/ for
instructions on how to install the required dependencies.
"""))
raise
warnings.filterwarnings('ignore', 'could not open display')

View File

@ -4,8 +4,23 @@ import logging
import os
import signal
import sys
import textwrap
try:
import gobject # noqa
except ImportError:
print(textwrap.dedent("""
ERROR: The gobject Python package was not found.
Mopidy requires GStreamer (and GObject) to work. These are C libraries
with a number of dependencies themselves, and cannot be installed with
the regular Python tools like pip.
Please see http://docs.mopidy.com/en/latest/installation/ for
instructions on how to install the required dependencies.
"""))
raise
import gobject
gobject.threads_init()
try: