лишний метод

sandbox1
inpos 2016-03-14 09:39:33 +03:00
parent 5e1b05d4a9
commit 10609b85f6
2 changed files with 7 additions and 8 deletions

View File

@ -215,8 +215,7 @@ class Engine:
self._log('ERROR: %s' % (message,))
pyrrent2http.logging = Logging(self._log)
self.pyrrent2http = pyrrent2http.Pyrrent2http()
self.pyrrent2http.initConfig(**kwargs)
self.pyrrent2http = pyrrent2http.Pyrrent2http(**kwargs)
self.pyrrent2http.startSession()
self.pyrrent2http.startServices()
self.pyrrent2http.addTorrent()

View File

@ -522,12 +522,7 @@ def HttpHandlerFactory():
return HttpHandler
class Pyrrent2http(object):
def __init__(self):
self.torrentHandle = None
self.forceShutdown = False
self.session = None
self.magnet = False
def initConfig(self, uri = '', bindAddress = 'localhost:5001', downloadPath = '.',
def __init__(self, uri = '', bindAddress = 'localhost:5001', downloadPath = '.',
idleTimeout = -1, fileIndex = -1, keepComplete = False,
keepIncomplete = False, keepFiles = False, showAllStats = False,
showOverallProgress = False, showFilesProgress = False,
@ -540,6 +535,11 @@ class Pyrrent2http(object):
minReconnectTime = 60, maxFailCount = 3, noSparseFile = False,
randomPort = False, enableScrape = False, enableDHT = True,
enableLSD = True, enableUPNP = True, enableNATPMP = True, enableUTP = True, enableTCP = True):
self.torrentHandle = None
self.forceShutdown = False
self.session = None
self.magnet = False
self.config = Struct()
self.config.uri = uri
self.config.bindAddress = bindAddress