mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
d221e7e448
commit
e6473047fe
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user