From 10609b85f6139df5918d3b20bf96fede37e84375 Mon Sep 17 00:00:00 2001 From: inpos Date: Mon, 14 Mar 2016 09:39:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pyrrent2http/engine.py | 3 +-- lib/pyrrent2http/pyrrent2http.py | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) 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