import json
class HTML:
@staticmethod
def header(title = '', reldir = ''):
return f"""
Kumiko Reader
{title}
"""
@staticmethod
def nbdiffs(files_diff):
return f"{len(files_diff)} differences found in files
"
pageId = 0
@staticmethod
def side_by_side_panels(title, step_info, jsons, v1, v2, images_dir, known_panels, diff_numbering_panels):
html = f"""
{title}
{step_info}
{v1} − processing time {jsons[0][0]['processing_time'] if 'processing_time' in jsons[0][0] else "??"}s
{v2} - processing time {jsons[1][0]['processing_time']}s
"""
oneside = """
"""
i = -1
for js in jsons:
i += 1
html += oneside.format(
id = HTML.pageId,
json = json.dumps(js),
images_dir = json.dumps(images_dir),
known_panels = known_panels[i],
diff_numbering_panels = diff_numbering_panels
)
HTML.pageId += 1
html += '
'
return html
@staticmethod
def imgbox(images):
html = "Debugging images
\n\n"
for img in images:
html += f"\t
{img['label']}

\n"
return html + "
\n\n"
@staticmethod
def reader(js, images_dir):
return f"""
"""
footer = """
"""