fix bug in pdb metadata. Allow ztxt to use pdb metadata info.

This commit is contained in:
John Schember 2009-05-03 10:59:54 -04:00
parent daf6e43523
commit 6bfe619896
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ def get_metadata(stream, extract_cover=True):
MetadataReader = MREADER.get(pheader.ident, None)
if MetadataReader is None:
return MetaInformation(_('Unknown'), [_('Unknown')])
return MetaInformation(pheader.title, [_('Unknown')])
return MetadataReader(stream, extract_cover)

View File

@ -34,6 +34,7 @@ class HeaderRecord(object):
class Reader(FormatReader):
def __init__(self, header, stream, log, encoding=None):
self.stream = stream
self.log = log
self.encoding = encoding
@ -69,7 +70,8 @@ class Reader(FormatReader):
with open(os.path.join(output_dir, 'index.html'), 'wb') as index:
index.write(html.encode('utf-8'))
mi = MetaInformation(_('Unknown'), _('Unknown'))
from calibre.ebooks.metadata.meta import get_metadata
mi = get_metadata(self.stream, 'pdb')
manifest = [('index.html', None)]
spine = ['index.html']
opf_writer(output_dir, 'metadata.opf', manifest, spine, mi)