Commit b61b7177 authored by rgaudin's avatar rgaudin
Browse files

allow retrieval of files without checksum

parent 4ce1e8a7
......@@ -43,7 +43,7 @@ class RequestedFile(object):
return rf
def from_disk(cls, url, fpath, checksum):
def from_disk(cls, url, fpath, checksum=None):
rf = cls(url, fpath)
rf.checksum = checksum
......@@ -75,7 +75,8 @@ class RequestedFile(object):
def verified(self):
return self.present and get_checksum(self.fpath) == self.checksum
return self.present and (
get_checksum(self.fpath) == self.checksum or self.checksum == None)
def stream(url, write_to=None, callback=None, block_size=1024):
......@@ -144,6 +145,8 @@ def download_if_missing(url, fpath, logger, checksum=None):
return RequestedFile.from_disk(url, fpath, checksum)
elif os.path.exists(fpath):
return RequestedFile.from_disk(url, fpath)
return download_file(url, fpath, logger, checksum)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment