Small fix deluge

This commit is contained in:
mikke89
2014-01-21 01:12:34 +01:00
parent 009d6cafaf
commit dfbb84caae
+3 -3
View File
@@ -21,20 +21,20 @@ class Deluge(Downloader):
drpc = None
testable = True
def connect(self):
def connect(self, reconnect = False):
# Load host from config and split out port.
host = cleanHost(self.conf('host'), protocol = False).split(':')
if not isInt(host[1]):
log.error('Config properties are not filled in correctly, port is missing.')
return False
if not (self.drpc and self.drpc.test()):
if not self.drpc or reconnect:
self.drpc = DelugeRPC(host[0], port = host[1], username = self.conf('username'), password = self.conf('password'))
return self.drpc
def test(self):
if self.connect() and self.drpc.test():
if self.connect(True) and self.drpc.test():
return True
return False