mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-21 13:41:30 +02:00
Removed superfluous lopen builtin
This commit is contained in:
@@ -289,7 +289,7 @@ class MobiReader(object):
|
||||
def write_as_utf8(path, data):
|
||||
if isinstance(data, str):
|
||||
data = data.encode('utf-8')
|
||||
with lopen(path, 'wb') as f:
|
||||
with open(path, 'wb') as f:
|
||||
f.write(data)
|
||||
|
||||
parse_cache[htmlfile] = root
|
||||
@@ -297,7 +297,7 @@ class MobiReader(object):
|
||||
ncx = io.BytesIO()
|
||||
opf, ncx_manifest_entry = self.create_opf(htmlfile, guide, root)
|
||||
self.created_opf_path = os.path.splitext(htmlfile)[0] + '.opf'
|
||||
opf.render(lopen(self.created_opf_path, 'wb'), ncx,
|
||||
opf.render(open(self.created_opf_path, 'wb'), ncx,
|
||||
ncx_manifest_entry=ncx_manifest_entry)
|
||||
ncx = ncx.getvalue()
|
||||
if ncx:
|
||||
|
||||
@@ -60,7 +60,7 @@ class Resources(object):
|
||||
try:
|
||||
from ebook_converter.utils.img import optimize_png
|
||||
optimize_png(pt.name)
|
||||
data = lopen(pt.name, 'rb').read()
|
||||
data = open(pt.name, 'rb').read()
|
||||
finally:
|
||||
os.remove(pt.name)
|
||||
return func(data)
|
||||
|
||||
Reference in New Issue
Block a user