forked from joshuajonah/boxee-torrentui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconnect.py
34 lines (28 loc) · 831 Bytes
/
connect.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import mc
from transmission_client import TransmissionClient
from rtorrent_client import RTorrentXMLRPCClient
from utorrent_client import uTorrent
from torrent_ui import rTorrentUI, uTorrentUI, TransmissionUI, TorrentUI
APP = mc.GetApp()
CONFIG = mc.GetApp().GetLocalConfig()
WINDOW = mc.GetWindow(14002)
TORRENT_CLIENTS={
"Transmission": TransmissionClient,
'RTorrent': RTorrentXMLRPCClient,
'uTorrent': uTorrent,
}
TORRENT_LIST=WINDOW.GetList(100)
UI = {
TransmissionClient: TransmissionUI,
uTorrent: uTorrentUI,
RTorrentXMLRPCClient: rTorrentUI
}
def create_connection(client, url=None, username=None, password=None):
if url is None:
conn = client()
else:
conn = client(url)
ui = UI[client](conn)
#TORRENT_LIST = ui.get_torrents()
ui.run()
return ui