diff --git a/session.vim b/session.vim index 9d326c5822..f33590c838 100644 --- a/session.vim +++ b/session.vim @@ -1,5 +1,5 @@ " Project wide builtins -let g:pyflakes_builtins += ["dynamic_property"] +let g:pyflakes_builtins += ["dynamic_property", "__"] python << EOFPY import os diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index 952978fc36..dd3128edef 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -508,11 +508,8 @@ class OPF(object): toc.partition('#')[0], toc.partition('#')[-1] self.toc.read_html_toc(toc) except: - raise pass - - def get_text(self, elem): return u''.join(self.CONTENT(elem) or self.TEXT(elem)) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 940b124d88..f7f02f7660 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -201,6 +201,9 @@ def urlnormalize(href): class OEBError(Exception): pass +class NotHTML(OEBError): + pass + class FauxLogger(object): def __getattr__(self, name): @@ -538,7 +541,7 @@ class Manifest(object): data = etree.fromstring(data, parser=RECOVER_PARSER) # Force into the XHTML namespace if barename(data.tag) != 'html': - raise OEBError( + raise NotHTML( 'File %r does not appear to be (X)HTML' % self.href) elif not namespace(data.tag): data.attrib['xmlns'] = XHTML_NS