I am trying to write a deluge client XBMC script to display the torrent status within XBMC.
I am trying to connect to the deluge daemon running locally, but cannot do so. Any help is appreciated I am posting a basic class I am building to connect to deluge daemon.
Code: Select all
#import xbmc
#import xbmcgui
from datetime import datetime
from deluge.common import ftime, fsize, fspeed
from deluge.ui.client import client
from twisted.internet import reactor
from optparse import OptionParser
import codecs
import logging
import os
import sys
class DelugeInfo:
uri = None
options = None
sessionstate = None
sessionstatefound = False
STATE_DOWNLOADING = 4
STATE_SEEDING = 3
STATE_QUEUED = 2
STATE_PAUSED = 1
STATE_UNKNOWN = 0
def __init__(self, options):
self.options = options
self.d = client.connect(host="127.0.0.1",port=58846,username="",password="")
print self.d
print client.connected()
def main():
options = None
delugeInfo = DelugeInfo(options)
if __name__ == '__main__':
main()
sys.exit()
print self.d outputs '<Deferred at 0x221be18>'
print client.connected() outputs 'False
and I do not get any server log where a connection attempt was made.
What am I doing wrong? Any help will be appreciated
Thank you
Edit:
I am using latest deluge 1.3.0_rc and python 2.6.
Eclipse ide with pyDev extension