summaryrefslogtreecommitdiffstats
path: root/module/network/Browser.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/network/Browser.py')
-rw-r--r--module/network/Browser.py10
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"})