Add __repr__ to Instaloader and InstaloaderContext

This commit is contained in:
Alexander Graf
2026-10-10 18:39:15 +02:00
parent 7efc78de12
commit 8f680ae52d
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -330,6 +330,9 @@ class Instaloader:
def __exit__(self, *args):
self.close()
def __repr__(self):
return f"<Instaloader context={self.context}>"
@_retry_on_connection_error
def download_pic(self, filename: str, url: str, mtime: datetime,
filename_suffix: Optional[str] = None, _attempt: int = 1) -> bool:
+3
View File
@@ -149,6 +149,9 @@ class InstaloaderContext:
if repeat_at_end:
self.error_log.append(msg)
def __repr__(self):
return f"<InstaloaderContext is_logged_in={self.is_logged_in}>"
@property
def has_stored_errors(self) -> bool:
"""Returns whether any error has been reported and stored to be repeated at program termination.