Wait until we're ready to connect to import transmissionrpc

This lets the GUI start and display a progress indicator before the
connection is attempted, so users aren't left hanging thinking nothing
is happening.
This commit is contained in:
Correl Roush 2011-03-27 02:19:08 -04:00
parent cf73454ff5
commit d5d921f8b2

View file

@ -6,7 +6,6 @@ import sys
import base64 import base64
import xbmc import xbmc
import xbmcgui import xbmcgui
import transmissionrpc
from basictypes.bytes import Bytes from basictypes.bytes import Bytes
from repeater import Repeater from repeater import Repeater
@ -32,6 +31,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
'user': __settings__.getSetting('rpc_user'), 'user': __settings__.getSetting('rpc_user'),
'password': __settings__.getSetting('rpc_password') 'password': __settings__.getSetting('rpc_password')
} }
import transmissionrpc
try: try:
self.transmission = transmissionrpc.transmission.Client(**params) self.transmission = transmissionrpc.transmission.Client(**params)
except transmissionrpc.transmission.TransmissionError: except transmissionrpc.transmission.TransmissionError:
@ -200,4 +200,4 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
pass pass