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 = []