FB2 input:Fix regression that prevented metadata from being read from input FB2 file when converting on the command line

This commit is contained in:
Kovid Goyal 2009-02-20 11:47:03 -08:00
parent d221e7e448
commit e6473047fe

View File

@ -38,6 +38,7 @@ def extract_embedded_content(doc):
open(fname, 'wb').write(data) open(fname, 'wb').write(data)
def to_html(fb2file, tdir): def to_html(fb2file, tdir):
fb2file = os.path.abspath(fb2file)
cwd = os.getcwd() cwd = os.getcwd()
try: try:
os.chdir(tdir) os.chdir(tdir)
@ -52,7 +53,7 @@ def to_html(fb2file, tdir):
result = transform(doc) result = transform(doc)
open('index.html', 'wb').write(transform.tostring(result)) open('index.html', 'wb').write(transform.tostring(result))
try: try:
mi = get_metadata(open(fb2file, 'rb')) mi = get_metadata(open(fb2file, 'rb'), 'fb2')
except: except:
mi = MetaInformation(None, None) mi = MetaInformation(None, None)
if not mi.title: if not mi.title: