Skip to content

Commit 0080f58

Browse files
author
renaud gaudin
committed
Fixed #37: fixed __repr__ for ReadArticle and File, added on Article
1 parent 03ac98b commit 0080f58

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libzim/wrapper.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ cdef class ReadArticle:
335335
return article
336336

337337
def __repr__(self):
338-
return f"{self.__class__.__name__}(url={self.longurl}, title=)"
338+
return f"{self.__class__.__name__}(url={self.longurl}, title={self.title})"
339339

340340

341341

@@ -575,4 +575,4 @@ cdef class FilePy:
575575
return dereference(search).get_matches_estimated()
576576

577577
def __repr__(self):
578-
return f"{self.__class__.__name__}(filename={self.filename}"
578+
return f"{self.__class__.__name__}(filename={self.filename})"

libzim/writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def _get_data(self):
6363
def get_data(self):
6464
raise NotImplementedError
6565

66+
def __repr__(self):
67+
return f"{self.__class__.__name__}(url={self.get_url()}, title={self.get_title()})"
68+
6669

6770
class MetadataArticle(Article):
6871
def __init__(self, url, metadata_content):

0 commit comments

Comments
 (0)