diff --git a/lib/pyrrent2http/engine.py b/lib/pyrrent2http/engine.py index 349285a..9d6c658 100644 --- a/lib/pyrrent2http/engine.py +++ b/lib/pyrrent2http/engine.py @@ -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() diff --git a/lib/pyrrent2http/pyrrent2http.py b/lib/pyrrent2http/pyrrent2http.py index 18a2ccd..f3cc278 100644 --- a/lib/pyrrent2http/pyrrent2http.py +++ b/lib/pyrrent2http/pyrrent2http.py @@ -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