define __repr__ for the Availability API class

This commit is contained in:
Akash Mahanty 2022-01-18 20:34:21 +05:30
parent 16b9bdd7f9
commit 66e16d6d89

View File

@ -36,6 +36,9 @@ class WaybackMachineAvailabilityAPI:
def unix_timestamp_to_wayback_timestamp(self, unix_timestamp): def unix_timestamp_to_wayback_timestamp(self, unix_timestamp):
return datetime.utcfromtimestamp(int(unix_timestamp)).strftime("%Y%m%d%H%M%S") return datetime.utcfromtimestamp(int(unix_timestamp)).strftime("%Y%m%d%H%M%S")
def __repr__(self):
return str(self) # self.__str__()
def __str__(self): def __str__(self):
if not self.JSON: if not self.JSON:
return None return None