This commit is contained in:
Kovid Goyal 2008-07-20 15:51:03 -07:00
parent b06d484a09
commit 0957cca3b3
2 changed files with 2 additions and 1 deletions

View File

@ -278,7 +278,7 @@ class OPF(MetaInformation):
def get_comments(self):
comments = self.soup.find('dc:description')
if comments:
if comments and comments.string:
return self.ENTITY_PATTERN.sub(entity_to_unicode, comments.string).strip()
return None

View File

@ -89,6 +89,7 @@ class TOC(list):
print 'Continuing anyway'
else:
path = opfreader.manifest.item(toc.lower())
path = getattr(path, 'path', path)
if path and os.access(path, os.R_OK):
self.read_ncx_toc(path)
return