show easy to understand error message on twisted importerror for the not so bright #796

This commit is contained in:
Marcos Pinto 2009-02-11 00:26:25 +00:00
parent 06bb660a10
commit ee05e18a9a
2 changed files with 13 additions and 7 deletions

View File

@ -30,9 +30,14 @@ import threading
import pkg_resources
import base64
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
import twisted.web.client
from deluge.log import LOG as log
try:
from twisted.internet import reactor
from twisted.internet.task import LoopingCall
import twisted.web.client
except ImportError:
log.error("You must install python-twisted")
try:
import deluge.libtorrent as lt
@ -54,8 +59,6 @@ from deluge.core.autoadd import AutoAdd
from deluge.core.authmanager import AuthManager
from deluge.core.rpcserver import export
from deluge.log import LOG as log
STATUS_KEYS = ['active_time', 'compact', 'distributed_copies', 'download_payload_rate', 'eta',
'file_priorities', 'file_progress', 'files', 'hash', 'is_auto_managed', 'is_seed', 'max_connections',
'max_download_speed', 'max_upload_slots', 'max_upload_speed', 'message', 'move_on_completed',

View File

@ -26,8 +26,11 @@
from deluge.log import LOG as log
# Install the twisted reactor
from twisted.internet import gtk2reactor
reactor = gtk2reactor.install()
try:
from twisted.internet import gtk2reactor
reactor = gtk2reactor.install()
except ImportError:
log.error("You must install python-twisted")
import gobject
import gettext