1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-25 03:43:33 +01:00

Removed prints and extract function from init module

This commit is contained in:
2020-07-13 21:38:06 +02:00
parent 025878dfe5
commit 4216fef20e
20 changed files with 97 additions and 336 deletions

View File

@@ -5,11 +5,9 @@ from various formats.
import numbers
import os
import re
import sys
from lxml import etree
from ebook_converter import prints
from ebook_converter.ebooks.chardet import xml_to_unicode
@@ -123,13 +121,14 @@ def render_html_data(path_to_html, width, height):
result = {}
def report_error(text=''):
prints('Failed to render', path_to_html, 'with errors:',
file=sys.stderr)
__import__('pdb').set_trace()
print(f'Failed to render {path_to_html}')
# file=sys.stderr)
if text:
prints(text, file=sys.stderr)
print(text) # , file=sys.stderr)
if result and result['stdout_stderr']:
with open(result['stdout_stderr'], 'rb') as f:
prints(f.read(), file=sys.stderr)
print(f.read()) # , file=sys.stderr)
with TemporaryDirectory('-render-html') as tdir:
try: