Check if python-twitter is available before registering plugin

This commit is contained in:
2009-11-18 15:00:23 +00:00
parent dee38f96a8
commit 121c4873df

View File

@@ -1,6 +1,5 @@
import logging
from flexget.plugin import *
import twitter
__pychecker__ = 'unusednames=parser'
@@ -69,4 +68,9 @@ class OutputTwitter:
else:
api.PostUpdate(content)
register_plugin(OutputTwitter, 'twitter')
try:
import twitter
except ImportError:
log.error('Unable to import module twitter, is python-twitter installed?')
else:
register_plugin(OutputTwitter, 'twitter')