Cleanup BookList classes

This commit is contained in:
Kovid Goyal 2010-05-16 21:47:00 -06:00
parent fcdcd68adf
commit f4a02e09d6
2 changed files with 16 additions and 12 deletions

View File

@ -387,7 +387,7 @@ class BookList(list):
__getslice__ = None __getslice__ = None
__setslice__ = None __setslice__ = None
def __init__(self, oncard, prefix): def __init__(self, oncard, prefix, settings):
pass pass
def supports_tags(self): def supports_tags(self):
@ -402,3 +402,17 @@ class BookList(list):
''' '''
raise NotImplementedError() raise NotImplementedError()
def add_book(self, book, replace_metadata):
'''
Add the book to the booklist. Intent is to maintain any device-internal
metadata. Return True if booklists must be sync'ed
'''
raise NotImplementedError()
def remove_book(self, book):
'''
Remove a book from the booklist. Correct any device metadata at the
same time
'''
raise NotImplementedError()

View File

@ -108,9 +108,6 @@ class Book(MetaInformation):
class BookList(_BookList): class BookList(_BookList):
def __init__(self, oncard, prefix, settings):
pass
def supports_tags(self): def supports_tags(self):
return True return True
@ -118,16 +115,9 @@ class BookList(_BookList):
book.tags = tags book.tags = tags
def add_book(self, book, replace_metadata): def add_book(self, book, replace_metadata):
'''
Add the book to the booklist. Intent is to maintain any device-internal
metadata. Return True if booklists must be sync'ed
'''
if book not in self: if book not in self:
self.append(book) self.append(book)
return True
def remove_book(self, book): def remove_book(self, book):
'''
Remove a book from the booklist. Correct any device metadata at the
same time
'''
self.remove(book) self.remove(book)