From 996dda3ffea65144cdb62fcd0e2c8c231f4f2325 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 Apr 2009 12:02:18 -0700 Subject: [PATCH] Fix regression in LIT metadata reader --- src/calibre/ebooks/lit/reader.py | 3 +++ src/calibre/ebooks/metadata/lit.py | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/lit/reader.py b/src/calibre/ebooks/lit/reader.py index 79249fe7c3..37328328b7 100644 --- a/src/calibre/ebooks/lit/reader.py +++ b/src/calibre/ebooks/lit/reader.py @@ -882,6 +882,9 @@ class LitContainer(object): unbin = UnBinary(raw, path, self._litfile.manifest, OPF_MAP) return str(unbin) + def get_metadata(self): + return self._read_meta() + class LitReader(OEBReader): Container = LitContainer diff --git a/src/calibre/ebooks/metadata/lit.py b/src/calibre/ebooks/metadata/lit.py index 2a57d2f2d2..0a37b6c768 100644 --- a/src/calibre/ebooks/metadata/lit.py +++ b/src/calibre/ebooks/metadata/lit.py @@ -4,15 +4,16 @@ __copyright__ = '2008, Kovid Goyal ' Support for reading the metadata from a LIT file. ''' -import sys, cStringIO, os +import cStringIO, os from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.metadata.opf2 import OPF -from calibre.ebooks.lit.reader import LitReader def get_metadata(stream): - litfile = LitReader(stream) - src = litfile.meta.encode('utf-8') + from calibre.ebooks.lit.reader import LitContainer + litfile = LitContainer(stream) + src = litfile.get_metadata().encode('utf-8') + litfile = litfile._litfile opf = OPF(cStringIO.StringIO(src), os.getcwd()) mi = MetaInformation(opf) covers = []