Exemple #1
0
def _read_url_info(url_path: str) -> checksums.UrlInfo:
    """Loads the `UrlInfo` from the `.INFO` file."""
    file_info = resource_lib.read_info_file(url_path)
    if 'url_info' not in file_info:
        raise ValueError(
            'Could not found `url_info` in {}. This likelly indicates that '
            'the files where downloaded with a previous version of TFDS (<=3.1.0). '
        )
    return checksums.UrlInfo(**file_info['url_info'])
def _read_url_info(url_path: type_utils.PathLike) -> checksums.UrlInfo:
    """Loads the `UrlInfo` from the `.INFO` file."""
    file_info = resource_lib.read_info_file(url_path)
    if 'url_info' not in file_info:
        raise ValueError(
            'Could not found `url_info` in {}. This likelly indicates that '
            'the files where downloaded with a previous version of TFDS (<=3.1.0). '
        )
    url_info = file_info['url_info']
    url_info.setdefault('filename', None)
    return checksums.UrlInfo(**url_info)