summaryrefslogtreecommitdiffstats
path: root/module/network/Request.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/network/Request.py')
-rwxr-xr-xmodule/network/Request.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index 0b518cf66..346412446 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -24,6 +24,9 @@ from cStringIO import StringIO
retrieveUrl returns response as string
"""
+class AbortDownload(Exception):
+ pass
+
class Request:
def __init__(self):
@@ -33,6 +36,8 @@ class Request:
self.dl_arrived = 0
self.dl = False
+ self.abort = False
+
self.cookies = []
self.lastURL = None
self.cj = cookielib.CookieJar()
@@ -146,6 +151,7 @@ class Request:
self.dl_arrived = 0
self.dl_time = time.time()
for chunk in conn:
+ if self.abort: raise AbortDownload
self.dl_arrived += len(chunk)
file.write(chunk)
file.close()