diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-25 20:20:33 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-25 20:20:33 +0100 |
commit | 805cb9d007e61edf2a211467b65b868bf35b49f1 (patch) | |
tree | 01d4df81dc689b5ed676dfee1024d263ec9507d7 /module/network/Browser.py | |
parent | cleanup stuff (diff) | |
download | pyload-805cb9d007e61edf2a211467b65b868bf35b49f1.tar.xz |
great fixes http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef0134872dea10970c-pi
Diffstat (limited to 'module/network/Browser.py')
-rw-r--r-- | module/network/Browser.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/module/network/Browser.py b/module/network/Browser.py index 23fe4993c..066b0e3ec 100644 --- a/module/network/Browser.py +++ b/module/network/Browser.py @@ -23,7 +23,7 @@ class Browser(object): self.http = HTTPBase(interface=interface, proxies=proxies) self.setCookieJar(cookieJar) self.proxies = proxies - self.abort = property(lambda: False, lambda val: self.abortDownloads()) + self.abort = property(lambda: False, lambda val: self.abortDownloads() if val else None) self.downloadConnections = [] @@ -84,12 +84,14 @@ class Browser(object): def _removeConnection(self, *args, **kwargs): i = self.downloadConnections.index(args[-1]) + self.downloadConnections[i].download.clean() del self.downloadConnections[i] def abortDownloads(self): for d in self.downloadConnections: + d.download.setAbort(True) d.abort = True - + @property def speed(self): speed = 0 @@ -149,7 +151,9 @@ class Browser(object): def clean(self): """ cleanup """ - self.http.clean() + if hasattr(self, "http"): + self.http.clean() + del self.http if __name__ == "__main__": browser = Browser()#proxies={"socks5": "localhost:5000"}) |