if not line or line.startswith("//"):
continue
// URL might have spaces inside, but size and checksum will not.
url, size, checksum = line.rsplit(" ", 2)
checksums[url] = (int(size), checksum)
return checksums
After Change
def _get_sizes_checksums(checksums_path):
Returns {URL: (size, checksum)}s stored within file at given path.
checksums_file = _read_file(checksums_path).split("\n")
return parse_sizes_checksums(checksums_file)
def parse_sizes_checksums(checksums_file):
Returns {URL: (size, checksum)}s stored within given file.