Sync to trunk.

This commit is contained in:
John Schember 2009-06-11 17:27:54 -04:00
commit ef66835b00
3 changed files with 10 additions and 3 deletions

View File

@ -25,7 +25,7 @@ class DRMError(ValueError):
BOOK_EXTENSIONS = ['lrf', 'rar', 'zip', 'rtf', 'lit', 'txt', 'htm', 'xhtm', BOOK_EXTENSIONS = ['lrf', 'rar', 'zip', 'rtf', 'lit', 'txt', 'htm', 'xhtm',
'html', 'xhtml', 'pdf', 'pdb', 'prc', 'mobi', 'azw', 'doc', 'html', 'xhtml', 'pdf', 'pdb', 'prc', 'mobi', 'azw', 'doc',
'epub', 'fb2', 'djvu', 'lrx', 'cbr', 'cbz', 'oebzip', 'epub', 'fb2', 'djvu', 'lrx', 'cbr', 'cbz', 'oebzip',
'rb', 'imp', 'odt', 'chm'] 'rb', 'imp', 'odt', 'chm', 'tpz', 'azw1']
class HTMLRenderer(object): class HTMLRenderer(object):

View File

@ -765,6 +765,13 @@ class Manifest(object):
data = etree.fromstring(data) data = etree.fromstring(data)
except: except:
data=data.replace(':=', '=').replace(':>', '>') data=data.replace(':=', '=').replace(':>', '>')
try:
data = etree.fromstring(data)
except etree.XMLSyntaxError:
self.oeb.logger.warn('Stripping comments from %s'%
self.href)
data = re.compile(r'<!--.*?-->', re.DOTALL).sub('',
data)
data = etree.fromstring(data) data = etree.fromstring(data)
elif namespace(data.tag) != XHTML_NS: elif namespace(data.tag) != XHTML_NS:
# OEB_DOC_NS, but possibly others # OEB_DOC_NS, but possibly others

View File

@ -385,7 +385,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
self.action_view, self.action_save, None, None) self.action_view, self.action_save, None, None)
QObject.connect(self.library_view, QObject.connect(self.library_view,
SIGNAL('files_dropped(PyQt_PyObject)'), SIGNAL('files_dropped(PyQt_PyObject)'),
self.files_dropped) self.files_dropped, Qt.QueuedConnection)
for func, target in [ for func, target in [
('connect_to_search_box', self.search), ('connect_to_search_box', self.search),
('connect_to_book_display', ('connect_to_book_display',