add: staticmethod decorator to no-self-use methods

This commit is contained in:
eggplants
2022-02-04 07:54:27 +09:00
parent 5a324b9f61
commit 858c486b99
3 changed files with 8 additions and 5 deletions

View File

@@ -33,7 +33,8 @@ class WaybackMachineAvailabilityAPI(object):
self.api_call_time_gap = 5
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.
"""
@@ -153,7 +154,8 @@ class WaybackMachineAvailabilityAPI(object):
)
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
are conformable with the YYYYMMDDhhmmss wayback machine timestamp format.

View File

@@ -98,7 +98,7 @@ def check_collapses(collapses: List[str]) -> bool:
"is not following the cdx collapse syntax."
)
raise WaybackError(exc_message)
else:
return True

View File

@@ -108,7 +108,8 @@ class WaybackMachineSaveAPI(object):
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
don't waste the retries before the page is even captured by the Wayback