mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanup BookList classes
This commit is contained in:
parent
fcdcd68adf
commit
f4a02e09d6
@ -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()
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user