add: staticmethod decorator to no-self-use methods
This commit is contained in:
@@ -33,7 +33,8 @@ class WaybackMachineAvailabilityAPI(object):
|
|||||||
self.api_call_time_gap = 5
|
self.api_call_time_gap = 5
|
||||||
self.JSON: Optional[ResponseJSON] = None
|
self.JSON: Optional[ResponseJSON] = None
|
||||||
|
|
||||||
def unix_timestamp_to_wayback_timestamp(self, unix_timestamp: int) -> str:
|
@staticmethod
|
||||||
|
def unix_timestamp_to_wayback_timestamp(unix_timestamp: int) -> str:
|
||||||
"""
|
"""
|
||||||
Converts Unix time to wayback Machine timestamp.
|
Converts Unix time to wayback Machine timestamp.
|
||||||
"""
|
"""
|
||||||
@@ -153,7 +154,8 @@ class WaybackMachineAvailabilityAPI(object):
|
|||||||
)
|
)
|
||||||
return archive_url
|
return archive_url
|
||||||
|
|
||||||
def wayback_timestamp(self, **kwargs: int) -> str:
|
@staticmethod
|
||||||
|
def wayback_timestamp(**kwargs: int) -> str:
|
||||||
"""
|
"""
|
||||||
Prepends zero before the year, month, day, hour and minute so that they
|
Prepends zero before the year, month, day, hour and minute so that they
|
||||||
are conformable with the YYYYMMDDhhmmss wayback machine timestamp format.
|
are conformable with the YYYYMMDDhhmmss wayback machine timestamp format.
|
||||||
|
@@ -98,8 +98,8 @@ def check_collapses(collapses: List[str]) -> bool:
|
|||||||
"is not following the cdx collapse syntax."
|
"is not following the cdx collapse syntax."
|
||||||
)
|
)
|
||||||
raise WaybackError(exc_message)
|
raise WaybackError(exc_message)
|
||||||
else:
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def check_match_type(match_type: Optional[str], url: str) -> bool:
|
def check_match_type(match_type: Optional[str], url: str) -> bool:
|
||||||
|
@@ -108,7 +108,8 @@ class WaybackMachineSaveAPI(object):
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def sleep(self, tries: int) -> None:
|
@staticmethod
|
||||||
|
def sleep(tries: int) -> None:
|
||||||
"""
|
"""
|
||||||
Ensure that the we wait some time before succesive retries so that we
|
Ensure that the we wait some time before succesive retries so that we
|
||||||
don't waste the retries before the page is even captured by the Wayback
|
don't waste the retries before the page is even captured by the Wayback
|
||||||
|
Reference in New Issue
Block a user