use 'Content-Length' to determine incomplete downloads (#29)
This commit is contained in:
@@ -255,6 +255,7 @@ class TestJob(DownloadJob):
|
||||
def __init__(self, hashobj):
|
||||
self.hashobj = hashobj
|
||||
self.path = ""
|
||||
self.size = 0
|
||||
self.has_extension = True
|
||||
|
||||
def __enter__(self):
|
||||
@@ -264,12 +265,17 @@ class TestJob(DownloadJob):
|
||||
pass
|
||||
|
||||
def open(self):
|
||||
self.size = 0
|
||||
return self
|
||||
|
||||
def write(self, content):
|
||||
"""Update SHA1 hash"""
|
||||
self.size += len(content)
|
||||
self.hashobj.update(content)
|
||||
|
||||
def tell(self):
|
||||
return self.size
|
||||
|
||||
def __init__(self, url, parent=None, content=False):
|
||||
DownloadJob.__init__(self, url, parent)
|
||||
self.content = content
|
||||
|
||||
Reference in New Issue
Block a user