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 config['enabled_plugins'] = ep
default_disabled_plugins = set([ default_disabled_plugins = set([
'Douban Books', 'Douban.com covers', 'Nicebooks', 'Nicebooks covers', 'Overdrive',
'Kent District Library'
]) ])
def is_disabled(plugin): def is_disabled(plugin):

View File

@ -41,7 +41,7 @@ class OverDrive(Source):
cached_cover_url_is_reliable = True cached_cover_url_is_reliable = True
options = ( options = (
Option('get_full_metadata', 'bool', False, Option('get_full_metadata', 'bool', True,
_('Download all metadata (slow)'), _('Download all metadata (slow)'),
_('Enable this option to gather all metadata available from Overdrive.')), _('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): def convert_new(self, stream, accelerators):
from calibre.ebooks.pdf.reflow import PDFDocument from calibre.ebooks.pdf.reflow import PDFDocument
from calibre.utils.cleantext import clean_ascii_chars
if pdfreflow_err: if pdfreflow_err:
raise RuntimeError('Failed to load pdfreflow: ' + pdfreflow_err) raise RuntimeError('Failed to load pdfreflow: ' + pdfreflow_err)
pdfreflow.reflow(stream.read(), 1, -1) 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) PDFDocument(xml, self.opts, self.log)
return os.path.join(os.getcwd(), 'metadata.opf') return os.path.join(os.getcwd(), 'metadata.opf')

View File

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

View File

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