1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-03 19:23:32 +02:00

Removed isworker variable from old constants.

This commit is contained in:
2020-06-17 18:15:29 +02:00
parent 0e040b1e5e
commit cd93b85eb0
3 changed files with 3 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ from threading import Thread
from ebook_converter import walk, prints
from ebook_converter.constants_old import iswindows, isosx
from ebook_converter.constants_old import plugins, DEBUG, isworker
from ebook_converter.constants_old import plugins, DEBUG
from ebook_converter.constants_old import filesystem_encoding
from ebook_converter.utils.fonts.metadata import FontMetadata, UnsupportedFont
@@ -308,14 +308,6 @@ class FontScanner(Thread):
def do_scan(self):
self.reload_cache()
if isworker:
# Dont scan font files in worker processes, use whatever is
# cached. Font files typically dont change frequently enough to
# justify a rescan in a worker process.
self.build_families()
return
cached_fonts = self.cached_fonts.copy()
self.cached_fonts.clear()
for folder in self.folders:

View File

@@ -100,9 +100,10 @@ def colored(text, fg=None, bg=None, bold=False):
class Detect(object):
def __init__(self, stream):
__import__('pdb').set_trace()
self.stream = stream or sys.stdout
self.isatty = getattr(self.stream, 'isatty', lambda : False)()
force_ansi = 'CALIBRE_FORCE_ANSI' in os.environ
force_ansi = False
if not self.isatty and force_ansi:
self.isatty = True
self.isansi = force_ansi or not iswindows