# HG changeset patch # User Goffi # Date 1443626709 -7200 # Node ID 94901070478ea6129f0422c2a54994d846918f5e # Parent 685fad1c18e48b0bcac40b74678345659075988e plugins: added new MissingModule exceptions to plugins using third party modules diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_adhoc_dbus.py --- a/src/plugins/plugin_adhoc_dbus.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_adhoc_dbus.py Wed Sep 30 17:25:09 2015 +0200 @@ -24,8 +24,11 @@ from sat.core import exceptions from twisted.internet import defer from wokkel import data_form -from lxml import etree -from os import path +try: + from lxml import etree +except ImportError: + raise exceptions.MissingModule(u"Missing module lxml, please download/install it from http://lxml.de/") +import os.path import uuid import dbus from dbus.mainloop.glib import DBusGMainLoop diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_misc_radiocol.py --- a/src/plugins/plugin_misc_radiocol.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_misc_radiocol.py Wed Sep 30 17:25:09 2015 +0200 @@ -29,10 +29,13 @@ import copy import time from os import unlink -from mutagen.oggvorbis import OggVorbis, OggVorbisHeaderError -from mutagen.mp3 import MP3, HeaderNotFoundError -from mutagen.easyid3 import EasyID3 -from mutagen.id3 import ID3NoHeaderError +try: + from mutagen.oggvorbis import OggVorbis, OggVorbisHeaderError + from mutagen.mp3 import MP3, HeaderNotFoundError + from mutagen.easyid3 import EasyID3 + from mutagen.id3 import ID3NoHeaderError +except ImportError: + raise exceptions.MissingModule(u"Missing module Mutagen, please download/install from https://bitbucket.org/lazka/mutagen") NC_RADIOCOL = 'http://www.goffi.org/protocol/radiocol' diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_misc_text_syntaxes.py --- a/src/plugins/plugin_misc_text_syntaxes.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_misc_text_syntaxes.py Wed Sep 30 17:25:09 2015 +0200 @@ -24,8 +24,11 @@ from twisted.internet import defer from twisted.internet.threads import deferToThread from sat.core import exceptions -from lxml import html -from lxml.html import clean +try: + from lxml import html + from lxml.html import clean +except ImportError: + raise exceptions.MissingModule(u"Missing module lxml, please download/install it from http://lxml.de/") from cgi import escape import re diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_xep_0054.py --- a/src/plugins/plugin_xep_0054.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_xep_0054.py Wed Sep 30 17:25:09 2015 +0200 @@ -37,7 +37,10 @@ from hashlib import sha1 from sat.core import exceptions from sat.memory import persistent -from PIL import Image +try: + from PIL import Image +except: + raise exceptions.MissingModule(u"Missing module pillow, please download/install it from https://python-pillow.github.io") from cStringIO import StringIO try: diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_xep_0071.py --- a/src/plugins/plugin_xep_0071.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_xep_0071.py Wed Sep 30 17:25:09 2015 +0200 @@ -25,7 +25,10 @@ from wokkel import disco, iwokkel from zope.interface import implements # from lxml import etree -from lxml import html +try: + from lxml import html +except ImportError: + raise exceptions.MissingModule(u"Missing module lxml, please download/install it from http://lxml.de/") try: from twisted.words.protocols.xmlstream import XMPPHandler except ImportError: diff -r 685fad1c18e4 -r 94901070478e src/plugins/plugin_xep_0277.py --- a/src/plugins/plugin_xep_0277.py Wed Sep 30 17:24:21 2015 +0200 +++ b/src/plugins/plugin_xep_0277.py Wed Sep 30 17:25:09 2015 +0200 @@ -31,7 +31,10 @@ # XXX: tmp.pubsub is actually use instead of wokkel version from wokkel import pubsub -from feed.date import rfc3339 +try: + from feed.date import rfc3339 +except ImportError: + raise exceptions.MissingModule(u"Missing module pyfeed, please download/install it from http://home.avvanta.com/~steveha/pyfeed.html") import uuid import time import urlparse