fix for demandimport

This commit is contained in:
Denis Fomin 2010-12-18 11:11:58 +03:00
parent 536ff02af8
commit 4cffef6be2
3 changed files with 13 additions and 19 deletions

View File

@ -135,22 +135,22 @@ ZEROCONF_ACC_NAME = 'Local'
HAVE_ZEROCONF = True
try:
import avahi
__import__('avahi')
except ImportError:
try:
import pybonjour
__import__('pybonjour')
except Exception: # Linux raises ImportError, Windows raises WindowsError
HAVE_ZEROCONF = False
HAVE_PYCRYPTO = True
try:
import Crypto
__import__('Crypto')
except ImportError:
HAVE_PYCRYPTO = False
HAVE_GPG = True
try:
import gnupg
__import__('gnupg', globals(), locals(), [], -1)
except ImportError:
HAVE_GPG = False
else:
@ -164,7 +164,8 @@ HAVE_LATEX = False
HAVE_FARSIGHT = True
try:
import farsight, gst
__import__('farsight')
__import__('gst')
except ImportError:
HAVE_FARSIGHT = False
gajim_identity = {'type': 'pc', 'category': 'client', 'name': 'Gajim'}

View File

@ -165,14 +165,7 @@ class FeaturesWindow:
return True
def zeroconf_available(self):
try:
import avahi
except Exception:
try:
import pybonjour
except Exception:
return False
return True
return gajim.HAVE_ZEROCONF
def dbus_available(self):
if os.name == 'nt':
@ -193,7 +186,7 @@ class FeaturesWindow:
if os.name == 'nt':
return False
try:
import gnome.ui
__import__('gnome.ui')
except Exception:
return False
return True
@ -204,7 +197,7 @@ class FeaturesWindow:
if kwalletbinding.kwallet_available():
return True
try:
import gnomekeyring
__import__('gnomekeyring')
except Exception:
return False
return True
@ -218,7 +211,7 @@ class FeaturesWindow:
if os.name == 'nt':
return False
try:
import gtkspell
__import__('gtkspell')
except ImportError:
return False
return True
@ -230,7 +223,7 @@ class FeaturesWindow:
if self.dbus_available() and dbus_support.get_notifications_interface():
return True
try:
import pynotify
__import__('pynotify')
except Exception:
return False
return True
@ -248,7 +241,7 @@ class FeaturesWindow:
def docutils_available(self):
try:
import docutils
__import__('docutils')
except Exception:
return False
return True

View File

@ -39,7 +39,7 @@ from common import demandimport
demandimport.enable()
demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n',
'logging.NullHandler', 'dbus.glib', 'dbus.service',
'command_system.implementation.standard']
'command_system.implementation.standard', 'OpenSSL.SSL', 'OpenSSL.crypto']
import os
import sys