1
0
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:
2020-04-20 21:12:22 +02:00
parent 3ca3f08054
commit 9e076e0af4
38 changed files with 107 additions and 195 deletions
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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