Add useful reprs to books & search results for debugging.

This commit is contained in:
Adam Kelly
2020-03-24 16:56:53 +00:00
parent 03a71b1c37
commit 8fb082e2fc
2 changed files with 8 additions and 1 deletions

View File

@ -53,8 +53,12 @@ class AbstractConnector(ABC):
class SearchResult(object):
''' standardized search result object '''
def __init__(self, title, key, author, year):
def __init__(self, title, key, author, year, raw_data):
self.title = title
self.key = key
self.author = author
self.year = year
self.raw_data = raw_data
def __repr__(self):
return "<SearchResult key={!r} title={!r} author={!r}>".format(self.key, self.title, self.author)