mirror of
https://github.com/nikdoof/flexget-plugins.git
synced 2025-12-17 19:59:23 +00:00
Check if python-twitter is available before registering plugin
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user