Fix #2624 (KeyError: 'last_læight_of_the_sun')

This commit is contained in:
Kovid Goyal 2009-06-17 08:44:53 -07:00
parent 5b1aacfdca
commit 77bfb1c08d
3 changed files with 10 additions and 10 deletions

View File

@ -1104,7 +1104,7 @@ class MobiWriter(object):
exth.write(data)
nrecs += 1
if oeb.metadata.cover:
id = str(oeb.metadata.cover[0])
id = unicode(oeb.metadata.cover[0])
item = oeb.manifest.ids[id]
href = item.href
index = self._images[href] - 1

View File

@ -725,7 +725,7 @@ class Manifest(object):
self._data = data
def __repr__(self):
return 'Item(id=%r, href=%r, media_type=%r)' \
return u'Item(id=%r, href=%r, media_type=%r)' \
% (self.id, self.href, self.media_type)
def _parse_xhtml(self, data):

View File

@ -187,7 +187,7 @@ class SVGRasterizer(object):
covers = self.oeb.metadata.cover
if not covers:
return
cover = self.oeb.manifest.ids[str(covers[0])]
cover = self.oeb.manifest.ids[unicode(covers[0])]
if not cover.media_type == SVG_MIME:
return
width = (self.profile.width / 72) * self.profile.dpi