defined __str__ for Url objects, print func should print the url.
This commit is contained in:
parent
ce869177fd
commit
c8d0ad493a
@ -9,10 +9,16 @@ class Url:
|
|||||||
def __init__(self, url, user_agent=DEFAULT_USER_AGENT):
|
def __init__(self, url, user_agent=DEFAULT_USER_AGENT):
|
||||||
self.url = url
|
self.url = url
|
||||||
self.user_agent = str(user_agent)
|
self.user_agent = str(user_agent)
|
||||||
|
self.archive_url = None
|
||||||
self.wayback_machine_availability_api = WaybackMachineAvailabilityAPI(
|
self.wayback_machine_availability_api = WaybackMachineAvailabilityAPI(
|
||||||
self.url, user_agent=self.user_agent
|
self.url, user_agent=self.user_agent
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
if not self.archive_url:
|
||||||
|
self.newest()
|
||||||
|
return self.archive_url
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
self.wayback_machine_save_api = WaybackMachineSaveAPI(
|
self.wayback_machine_save_api = WaybackMachineSaveAPI(
|
||||||
self.url, user_agent=self.user_agent
|
self.url, user_agent=self.user_agent
|
||||||
|
Loading…
Reference in New Issue
Block a user