diff options
Diffstat (limited to 'output.py')
-rw-r--r-- | output.py | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -3,6 +3,7 @@ # Copyright © 2019-2020 Adélie Linux team. All rights reserved. # NCSA license. # +import datetime import functools import subprocess @@ -40,7 +41,7 @@ YES_MISSING = Yes("missing") _HEADER = r"""<!DOCTYPE html> <html> <head> - <title>APKINDEX analysis - {date}</title> + <title>APKINDEX analysis - %(date)s</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <style type="text/css"> table { @@ -66,11 +67,11 @@ _HEADER = r"""<!DOCTYPE html> </style> </head> <body> - <h1>APKINDEX analysis - {date}</h1> + <h1>APKINDEX analysis - %(date)s</h1> <p> - Base URL: <a href="{url}">{url}</a><br> - Repositories: {repos}<br> - Architectures: {arches}<br> + Base URL: <a href="%(url)s">%(url)s</a><br> + Repositories: %(repos)s<br> + Architectures: %(arches)s<br> </p> """ _FOOTER = r""" </body> @@ -106,7 +107,12 @@ def format_pretty(_, rows): proc.communicate() def format_html(opts, rows): - print(_HEADER) + print(_HEADER % { + "url": opts.url, + "repos": ", ".join(opts.repos), + "arches": ", ".join(opts.arches), + "date": datetime.datetime.now().strftime("%c"), + }) first = True for row in rows: |