Merge from trunk

This commit is contained in:
Charles Haley 2011-05-06 16:26:29 +01:00
commit 88f668c407
5 changed files with 10 additions and 7 deletions

View File

@ -92,8 +92,7 @@ def restore_plugin_state_to_default(plugin_or_name):
config['enabled_plugins'] = ep
default_disabled_plugins = set([
'Douban Books', 'Douban.com covers', 'Nicebooks', 'Nicebooks covers',
'Kent District Library'
'Overdrive',
])
def is_disabled(plugin):

View File

@ -41,7 +41,7 @@ class OverDrive(Source):
cached_cover_url_is_reliable = True
options = (
Option('get_full_metadata', 'bool', False,
Option('get_full_metadata', 'bool', True,
_('Download all metadata (slow)'),
_('Enable this option to gather all metadata available from Overdrive.')),
)

View File

@ -32,10 +32,11 @@ class PDFInput(InputFormatPlugin):
def convert_new(self, stream, accelerators):
from calibre.ebooks.pdf.reflow import PDFDocument
from calibre.utils.cleantext import clean_ascii_chars
if pdfreflow_err:
raise RuntimeError('Failed to load pdfreflow: ' + pdfreflow_err)
pdfreflow.reflow(stream.read(), 1, -1)
xml = open('index.xml', 'rb').read()
xml = clean_ascii_chars(open('index.xml', 'rb').read())
PDFDocument(xml, self.opts, self.log)
return os.path.join(os.getcwd(), 'metadata.opf')

View File

@ -295,9 +295,8 @@ class AuthorSortEdit(EnLineEdit):
return property(fget=fget, fset=fset)
def update_state_and_val(self):
au = unicode(self.authors_edit.text())
# Handle case change if the authors box changed
aus = authors_to_sort_string(string_to_authors(au))
aus = authors_to_sort_string(self.authors_edit.current_val)
if strcmp(aus, self.current_val) == 0:
self.current_val = aus
self.update_state()

View File

@ -292,13 +292,17 @@ class MetadataSingleDialogBase(ResizableDialog):
show=True)
return
def update_from_mi(self, mi):
def update_from_mi(self, mi, update_sorts=True):
if not mi.is_null('title'):
self.title.current_val = mi.title
if update_sorts:
self.title_sort.auto_generate()
if not mi.is_null('authors'):
self.authors.current_val = mi.authors
if not mi.is_null('author_sort'):
self.author_sort.current_val = mi.author_sort
elif update_sorts:
self.author_sort.auto_generate()
if not mi.is_null('rating'):
try:
self.rating.current_val = mi.rating