make flake8 happy

This commit is contained in:
Akash Mahanty
2022-02-07 13:10:25 +05:30
parent edec28d67f
commit 13373ae7f3

View File

@@ -71,21 +71,24 @@ class WaybackMachineCDXServerAPI(object):
) -> Generator[str, None, None]: ) -> Generator[str, None, None]:
""" """
Manages the API calls for the instance, it automatically selects the best Manages the API calls for the instance, it automatically selects the best
parameters by looking as the query of the end-user. For bigger queries automatically parameters by looking as the query of the end-user. For bigger queries
use the CDX pagination API and for smaller queries use the normal API. automatically use the CDX pagination API and for smaller queries use the
normal API.
CDX Server API is a complex API and to make it easy for the end user to consume it CDX Server API is a complex API and to make it easy for the end user to
the CDX manager(this method) handles the selection of the API output, whether to consume it the CDX manager(this method) handles the selection of the
use the pagination API or not. API output, whether to use the pagination API or not.
For doing large/bulk queries, the use of the Pagination API is recommended by the For doing large/bulk queries, the use of the Pagination API is
Wayback Machine authors. And it determines if the query would be large or not by recommended by the Wayback Machine authors. And it determines if the
using the showNumPages=true parameter, this tells the number of pages of CDX DATA query would be large or not by using the showNumPages=true parameter,
that the pagination API will return. this tells the number of pages of CDX DATA that the pagination API
If the number of page is less than 2 we use the normal non-pagination API as the will return.
pagination API is known to lag and for big queries it should not matter but for
queries where the number of pages are less this method chooses accuracy over the If the number of page is less than 2 we use the normal non-pagination
pagination API. API as the pagination API is known to lag and for big queries it should
not matter but for queries where the number of pages are less this
method chooses accuracy over the pagination API.
""" """
# number of pages that will returned by the pagination API. # number of pages that will returned by the pagination API.
@@ -242,9 +245,9 @@ class WaybackMachineCDXServerAPI(object):
if total_property_values != warranted_total_property_values: if total_property_values != warranted_total_property_values:
raise WaybackError( raise WaybackError(
f"Snapshot returned by Cdx API has {total_property_values} " f"Snapshot returned by CDX API has {total_property_values} prop"
f"properties instead of expected {warranted_total_property_values} properties.\n" f"erties instead of expected {warranted_total_property_values} "
f"Problematic Snapshot: {snapshot}" f"properties.\nProblematic Snapshot: {snapshot}"
) )
( (