def check_and_upload(url, filename, sha1): if not os.path.exists(filename) or utils.sha1(filename) != sha1: if not utils.copy_file_from_url(url, filename, sha1): return False return True
def write_sha1(out_dir, in_file): sha1 = utils.sha1(in_file) utils.write_sha1(sha1, out_dir + "sha1.sum")