More miscellaneous fixes

This commit is contained in:
Kovid Goyal 2009-05-14 12:35:59 -07:00
parent 7047b922a9
commit 92a1d8c4e7
6 changed files with 24 additions and 32 deletions

View File

@ -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 = [], [], []

View File

@ -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

View File

@ -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):

View File

@ -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()

View File

@ -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.

8
todo
View File

@ -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