Device drivers: Add a prepare_addable_books API method

This commit is contained in:
Kovid Goyal 2011-10-10 16:34:57 +05:30
parent 64f0f0fd9d
commit b25724a8ea
2 changed files with 7 additions and 0 deletions

View File

@ -518,3 +518,9 @@ class BookList(list):
'''
raise NotImplementedError()
def prepare_addable_books(self, paths):
'''
Given a list of paths, returns another list of paths. These paths
point to addable versions of the books.
'''
return paths

View File

@ -397,6 +397,7 @@ class AddAction(InterfaceAction):
d = error_dialog(self.gui, _('Add to library'), _('No book files found'))
d.exec_()
return
paths = self.gui.device_manager.device.prepare_addable_books(paths)
from calibre.gui2.add import Adder
self.__adder_func = partial(self._add_from_device_adder, on_card=None,
model=view.model())