client is not able to connect to deluge daemon on localhost

Suggestions and discussion of future versions
ddhariwal

client is not able to connect to deluge daemon on localhost

Postby ddhariwal » Mon Oct 03, 2011 6:26 pm

i Johny,

I am new to deluge and needed urgent help with it. I am running deluged -d as daemon and then I run the following code to connect

Code: Select all

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
# Set up the logger to print out errors
from deluge.log import setupLogger
setupLogger()


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
        d = client.connect()
        print d
        d.addCallback(self.on_connect_success)
        d.addErrback(self.on_connect_fail)
        reactor.run()


    def on_connect_success(result):
        print "connected"
        print "result: ", result
        client.disconnect()
        reactor.stop()

    def on_connect_fail(result):
        print "failed"
        print "result: ", result
        reactor.stop()
        pass

def main():
    options = None
    delugeInfo = DelugeInfo(options)



But I see that my reactor just runs and returns no result. I just get a deffered object thats it.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 4 guests