mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-20 13:11:27 +02:00
Removed superfluous lopen builtin
This commit is contained in:
@@ -245,7 +245,7 @@ class FontScanner(Thread):
|
||||
path = font_or_path
|
||||
if isinstance(font_or_path, dict):
|
||||
path = font_or_path['path']
|
||||
with lopen(path, 'rb') as f:
|
||||
with open(path, 'rb') as f:
|
||||
return f.read()
|
||||
|
||||
def find_font_for_text(self, text, allowed_families={'serif', 'sans-serif'},
|
||||
@@ -366,7 +366,7 @@ class FontScanner(Thread):
|
||||
self.write_cache()
|
||||
|
||||
def read_font_metadata(self, path, fileid):
|
||||
with lopen(path, 'rb') as f:
|
||||
with open(path, 'rb') as f:
|
||||
try:
|
||||
fm = FontMetadata(f)
|
||||
except UnsupportedFont:
|
||||
|
||||
@@ -441,7 +441,7 @@ def get_font_for_text(text, candidate_font_data=None):
|
||||
from ebook_converter.utils.fonts.scanner import font_scanner
|
||||
family, faces = font_scanner.find_font_for_text(text)
|
||||
if faces:
|
||||
with lopen(faces[0]['path'], 'rb') as f:
|
||||
with open(faces[0]['path'], 'rb') as f:
|
||||
candidate_font_data = f.read()
|
||||
return candidate_font_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user