diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 98377a86d7..6c2da7c536 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -494,7 +494,7 @@ class DeviceGUI(object): full_metadata = self.library_view.model().get_metadata( rows, full_metadata=True)[-1] files = self.library_view.model().get_preferred_formats(rows, - fmts, paths=True, set_metadata=True) + fmts, paths=True, set_metadata=True)[0] files = [getattr(f, 'name', None) for f in files] bad, remove_ids, jobnames = [], [], [] diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index f35a478847..e036223815 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -723,9 +723,6 @@ class BooksView(TableView): def close(self): self._model.close() - - def set_editable(self, editable): - self._model.set_editable(editable) def set_editable(self, editable): self._model.set_editable(editable) @@ -1019,10 +1016,6 @@ class DeviceBooksModel(BooksModel): self.sort(col, self.sorted_on[1]) done = True return done - - def set_editable(self, editable): - self.editable = editable - def set_editable(self, editable): self.editable = editable diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 5300655726..9724426460 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -200,17 +200,22 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): self.delete_books) QObject.connect(self.action_edit, SIGNAL("triggered(bool)"), self.edit_metadata) + self.__em1__ = partial(self.edit_metadata, bulk=False) QObject.connect(md.actions()[0], SIGNAL('triggered(bool)'), - partial(self.edit_metadata, bulk=False)) + self.__em1__) + self.__em2__ = partial(self.edit_metadata, bulk=True) QObject.connect(md.actions()[2], SIGNAL('triggered(bool)'), - partial(self.edit_metadata, bulk=True)) + self.__em2__) + self.__em3__ = partial(self.download_metadata, covers=True) QObject.connect(md.actions()[4], SIGNAL('triggered(bool)'), - partial(self.download_metadata, covers=True)) + self.__em3__) + self.__em4__ = partial(self.download_metadata, covers=False) QObject.connect(md.actions()[5], SIGNAL('triggered(bool)'), - partial(self.download_metadata, covers=False)) + self.__em4__) + self.__em5__ = partial(self.download_metadata, covers=True, + set_metadata=False) QObject.connect(md.actions()[6], SIGNAL('triggered(bool)'), - partial(self.download_metadata, covers=True, - set_metadata=False)) + self.__em5__) @@ -739,9 +744,10 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): if not paths: return from calibre.gui2.add import Adder + self.__adder_func = partial(self._files_added, on_card=on_card) self._adder = Adder(self, None if to_device else self.library_view.model().db, - Dispatcher(partial(self._files_added, on_card=on_card))) + Dispatcher(self.__adder_func)) self._adder.add(paths) def _files_added(self, paths=[], names=[], infos=[], on_card=False): diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index aa626f4852..d6df39b5d2 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -176,8 +176,8 @@ class LocationModel(QAbstractListModel): _('Click to see the list of books on storage card B in your reader') ] - def rowCount(self, parent): - return 1 + sum([1 for i in self.free if i >= 0]) + def rowCount(self, *args): + return 1 + len([i for i in self.free if i >= 0]) def data(self, index, role): row = index.row() diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index eca8eb0c93..e15e6eaa36 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -158,13 +158,14 @@ class BasicNewsRecipe(Recipe): #: Recipe specific options to control the conversion of the downloaded #: content into an e-book. These will override any user or plugin specified - #: values, so only use if absolutely necessary. For example: - #: conversion_options = { - #: 'base_font_size' : 16, - #: 'tags' : 'mytag1,mytag2', - #: 'title' : 'My Title', - #: 'linearize_tables' : True, - #: } + #: values, so only use if absolutely necessary. For example:: + #: conversion_options = { + #: 'base_font_size' : 16, + #: 'tags' : 'mytag1,mytag2', + #: 'title' : 'My Title', + #: 'linearize_tables' : True, + #: } + #: conversion_options = {} #: List of tags to be removed. Specified tags are removed from downloaded HTML. diff --git a/todo b/todo index 75be02c16e..b983508549 100644 --- a/todo +++ b/todo @@ -1,16 +1,8 @@ * Refactor web.fetch.simple to use per connection timeouts via the timeout kwarg for mechanize.open -* Refactor IPC code to use communication logic from multiprocessing - * Rationalize books table. Add a pubdate column, remove the uri column (and associated support in add_books) and convert series_index to a float. * Replace single application stuff with Listener from multiprocessing -* Refactor add books to use a separate process named calibre-worker-add - - Dont use the process for adding a single book - - Use a process pool for speed or multiple process for stability (20 per process?) - -* Change mobi metadata setter to use author_sort setting from MOBI output plugin instead of mobi.py - * Fix HTML-to-ZIP plugin