summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-08 16:34:38 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-08 16:42:15 +0100
commit5d664ec53ae22595302ad0f72c99d081439c0f08 (patch)
treeca2d6ae1bfe9efed11a5b339857a57297fe7f254
parentbaa89efdfcbdb4e1e108862d96d79be13f5cf114 (diff)
downloadjenkins.debian.net-5d664ec53ae22595302ad0f72c99d081439c0f08.tar.xz
reproducible: html.py: fix html indentation
-rwxr-xr-xbin/reproducible_common.py127
-rwxr-xr-xbin/reproducible_html_notes.py168
2 files changed, 187 insertions, 108 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index 874598d3..dd8b19f9 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -65,86 +65,95 @@ log.debug("REPRODUCIBLE_JSON:\t" + REPRODUCIBLE_JSON)
log.debug("JENKINS_URL:\t\t" + JENKINS_URL)
log.debug("REPRODUCIBLE_URL:\t" + REPRODUCIBLE_URL)
+
+tab = ' '
+
html_header = Template("""<!DOCTYPE html>
-<html>\n<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link href="/userContent/static/style.css" type="text/css" rel="stylesheet" />
-<title>$page_title</title>\n</head>
-<body>
-""")
-html_footer = Template("""<hr /><p style="font-size:0.9em;">There is more
-information <a href="%s/userContent/about.html">about jenkins.debian.net</a>
-and about <a href="https://wiki.debian.org/ReproducibleBuilds"> reproducible
-builds of Debian</a> available elsewhere. Last update: $date.
-Copyright 2014-%s <a href="mailto:holger@layer-acht.org">Holger Levsen</a>,
-GPL-2 licensed. The weather icons are public domain and have been taken from
-the <a href=http://tango.freedesktop.org/Tango_Icon_Library target=_blank>Tango
-Icon Library</a>.</p>
-</body></html>""" % (JENKINS_URL, datetime.datetime.now().strftime('%Y')))
-
-html_head_page = Template("""<header>
-<h2>$page_title</h2>
-<p>$count_total packages have been attempted to be build so far, that's
-$percent_total% of $amount source packages in Debian sid
-currently. Out of these, $count_good packagea ($percent_good%)
-<a href="https://wiki.debian.org/ReproducibleBuilds">could be built
-reproducible!</a></p>
-<ul>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link href="/userContent/static/style.css" type="text/css" rel="stylesheet" />
+ <title>$page_title</title>
+ </head>
+ <body>""")
+html_footer = Template("""
+ <hr />
+ <p style="font-size:0.9em;">
+ There is more information <a href="%s/userContent/about.html">about
+ jenkins.debian.net</a> and about
+ <a href="https://wiki.debian.org/ReproducibleBuilds"> reproducible builds
+ of Debian</a> available elsewhere. Last update: $date.
+ Copyright 2014-%s <a href="mailto:holger@layer-acht.org">Holger Levsen</a>,
+ GPL-2 licensed. The weather icons are public domain and have been taken
+ from the <a href=http://tango.freedesktop.org/Tango_Icon_Library target=_blank>
+ Tango Icon Library</a>.
+ </p>
+ </body>
+</html>""" % (JENKINS_URL, datetime.datetime.now().strftime('%Y')))
+
+html_head_page = Template((tab*2).join("""
+<header>
+ <h2>$page_title</h2>
+ <p>$count_total packages have been attempted to be build so far, that's
+ $percent_total% of $amount source packages in Debian sid
+ currently. Out of these, $count_good packagea ($percent_good%)
+ <a href="https://wiki.debian.org/ReproducibleBuilds">could be built
+ reproducible!</a></p>
+ <ul>
<li>Have a look at:</li>
<li>
- <a href="/userContent/index_reproducible.html" target="_parent">
- <img src="/userContent/static/weather-clear.png"
- alt="reproducible icon" /></a>
+ <a href="/userContent/index_reproducible.html" target="_parent">
+ <img src="/userContent/static/weather-clear.png" alt="reproducible icon" />
+ </a>
</li>
<li>
- <a href="/userContent/index_FTBR_with_buildinfo.html" target="_parent">
- <img src="/userContent/static/weather-showers-scattered.png"
- alt="FTBR_with_buildinfo icon" /></a>
+ <a href="/userContent/index_FTBR_with_buildinfo.html" target="_parent">
+ <img src="/userContent/static/weather-showers-scattered.png" alt="FTBR_with_buildinfo icon" />
+ </a>
</li>
<li>
- <a href="/userContent/index_FTBR.html" target="_parent">
+ <a href="/userContent/index_FTBR.html" target="_parent">
<img src="/userContent/static/weather-showers.png" alt="FTBR icon" />
- </a>
+ </a>
</li>
<li>
- <a href="/userContent/index_FTBFS.html" target="_parent">
+ <a href="/userContent/index_FTBFS.html" target="_parent">
<img src="/userContent/static/weather-storm.png" alt="FTBFS icon" />
- </a>
+ </a>
</li>
<li>
- <a href="/userContent/index_404.html" target="_parent">
- <img src="/userContent/static/weather-severe-alert.png"
- alt="404 icon" /></a>
+ <a href="/userContent/index_404.html" target="_parent">
+ <img src="/userContent/static/weather-severe-alert.png" alt="404 icon" />
+ </a>
</li>
<li>
- <a href="/userContent/index_not_for_us.html" target="_parent">
- <img src="/userContent/static/weather-few-clouds-night.png"
- alt="not_for_us icon" /></a>
+ <a href="/userContent/index_not_for_us.html" target="_parent">
+ <img src="/userContent/static/weather-few-clouds-night.png" alt="not_for_us icon" />
+ </a>
</li>
<li>
- <a href="/userContent/index_blacklisted.html" target="_parent">
- <img src="/userContent/static/error.png" alt="blacklisted icon" />
- </a>
+ <a href="/userContent/index_blacklisted.html" target="_parent">
+ <img src="/userContent/static/error.png" alt="blacklisted icon" />
+ </a>
</li>
- <li><a href="/userContent/index_issues.html">issues</a></li
- <li><li><a href="/userContent/index_notes.html">packages with notes</a></li></li>
+ <li><a href="/userContent/index_issues.html">issues</a></li>
+ <li><a href="/userContent/index_notes.html">packages with notes</a></li>
<li><a href="/userContent/index_scheduled.html">currently scheduled</a></li>
- <li><a href="/userContent/index_last_24h.html">packages tested in the last
- 24h</a></li>
- <li><a href="/userContent/index_last_48h.html">packages tested in the last
- 48h</a></li>
- <li><a href="/userContent/index_all_abc.html">all tested packages (sorted
- alphabetically)</a></li>
- <li><a href="/userContent/index_dd-list.html">maintainers of unreproducible
- packages</a></li>
+ <li><a href="/userContent/index_last_24h.html">packages tested in the last 24h</a></li>
+ <li><a href="/userContent/index_last_48h.html">packages tested in the last 48h</a></li>
+ <li><a href="/userContent/index_all_abc.html">all tested packages (sorted alphabetically)</a></li>
+ <li><a href="/userContent/index_dd-list.html">maintainers of unreproducible packages</a></li>
<li><a href="/userContent/index_stats.html">stats</a></li>
<li><a href="/userContent/index_pkg_sets.html">package sets stats</a></li>
-</ul></header>""")
-
-html_foot_page = Template("""
-<p style="font-size:0.9em;">A package name displayed with a bold font is an
-indication that this package has a note. Visited packages are linked in green,
-those which have not been visited are linked in blue.</p>""")
+ </ul>
+</header>""".splitlines(keepends=True)))
+
+html_foot_page = Template((tab*2).join("""
+<p style="font-size:0.9em;">
+ A package name displayed with a bold font is an indication that this
+ package has a note. Visited packages are linked in green, those which
+ have not been visited are linked in blue.
+</p>""".splitlines(keepends=True)))
url2html = re.compile(r'((mailto\:|((ht|f)tps?)\://|file\:///){1}\S+)')
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index e7b28d07..99505ad7 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -13,58 +13,127 @@ from reproducible_common import *
NOTES = 'packages.yml'
ISSUES = 'issues.yml'
-note_html = Template("""<table class="body">
-<tr>
+note_html = Template((tab*2).join("""
+<table class="body">
+ <tr>
<td>Version annotated:</td>
<td>$version</td>
-</tr>
-$infos
-<tr>
+ </tr>
+ $infos
+ <tr>
<td colspan="2">&nbsp;</td>
-</tr>
-<tr>
+ </tr>
+ <tr>
<td colspan="2" style="text-align:right; font-size:0.9em;">
- <p>Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.</p>
+ <p>
+ Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.
+ </p>
</td>
-</tr>
-</table>""")
-note_issues_html = Template("<tr><td>Identified issues:</td><td>$issues</td></tr>")
-note_bugs_html = Template("<tr><td>Bugs noted:</td><td>$bugs</td></tr>")
-note_comments_html = Template("<tr><td>Comments:</td><td>$comments</td></tr>")
-
-note_issue_html_url = Template("""<tr><td>URL</td>
- <td><a href="$url" target="_blank">$url</a></td></tr>""")
-note_issue_html_desc = Template("""<tr><td>Description</td>
- <td>$description</td></tr>""")
-note_issue_html = Template("""<table class="body">
+ </tr>
+</table>""".splitlines(keepends=True)))
+note_issues_html = Template((tab*3).join("""
<tr>
- <td>Identifier:</td>
- <td><a href="%s/${issue}_issue.html" target="_parent">$issue</a>
-</tr>
-$issue_info
-</table>
-""" % ISSUES_URI)
+ <td>
+ Identified issues:
+ </td>
+ <td>
+ $issues
+ </td>
+</tr>""".splitlines(keepends=True)))
+note_bugs_html = Template((tab*4).join("""
+<tr>
+ <td>
+ Bugs noted:
+ </td>
+ <td>
+ $bugs
+ </td>
+</tr>""".splitlines(keepends=True)))
+note_comments_html = Template((tab*3).join("""
+<tr>
+ <td>
+ Comments:
+ </td>
+ <td>
+ $comments
+ </td>
+</tr>""".splitlines(keepends=True)))
-issue_html_url = Template("""<tr><td>URL:</td><td><a href="$url">$url</a>
- </td></tr>""")
-issue_html = Template("""<table class="body">
+note_issue_html_url = Template((tab*6).join("""
<tr>
- <td>Identifier:</td>
- <th>$issue</th>
-</tr>
-$urls
+ <td>
+ URL
+ </td>
+ <td>
+ <a href="$url" target="_blank">$url</a>
+ </td>
+</tr>""".splitlines(keepends=True)))
+note_issue_html_desc = Template((tab*6).join("""
<tr>
- <td>Description:</td>
- <td>$description</td>
-</tr>
+ <td>
+ Description
+ </td>
+ <td>
+ $description
+ </td>
+</tr>""".splitlines(keepends=True)))
+note_issue_html = Template((tab*5).join(("""
+<table class="body">
+ <tr>
+ <td>
+ Identifier:
+ </td>
+ <td>
+ <a href="%s/${issue}_issue.html" target="_parent">$issue</a>
+ </td>
+ </tr>
+ $issue_info
+</table>
+""" % ISSUES_URI).splitlines(keepends=True)))
+
+issue_html_url = Template((tab*4).join("""
<tr>
- <td>Packages known to be affected by this issue:</td>
- <td>$affected_pkgs</td>
-</tr>
-<tr><td colspan="2">&nbsp;</td></tr>
-<tr><td colspan="2" style="text-align:right; font-size:0.9em;">
-<p>Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.</p>
-</td></tr></table>""")
+ <td>
+ URL:
+ </td>
+ <td>
+ <a href="$url">$url</a>
+ </td>
+</tr>""".splitlines(keepends=True)))
+issue_html = Template((tab*3).join("""
+<table class="body">
+ <tr>
+ <td>
+ Identifier:
+ </td>
+ <th>
+ $issue
+ </th>
+ </tr>
+ $urls
+ <tr>
+ <td>
+ Description:
+ </td>
+ <td>
+ $description
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Packages known to be affected by this issue:
+ </td>
+ <td>
+$affected_pkgs
+ </td>
+ </tr>
+ <tr><td colspan="2">&nbsp;</td></tr>
+ <tr>
+ <td colspan="2" style="text-align:right; font-size:0.9em;">
+ <p>Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.</p>
+ </td>
+ </tr>
+</table>""".splitlines(keepends=True)))
def load_notes():
@@ -156,7 +225,7 @@ def gen_html_issue(issue):
# add affected packages:
affected = ''
for pkg in sorted(issues_count[issue]):
- affected += '<a href="%s/%s.html" class="noted">%s</a>\n' % (
+ affected += tab*6 + '<a href="%s/%s.html" class="noted">%s</a>\n' % (
RB_PKG_URI, pkg, pkg)
# check for description:
try:
@@ -216,13 +285,14 @@ def iterate_over_issues(issues):
i = i + 1
def index_issues(issues):
- html = '<table class="body">'
- html += '<tr><th>Identified issues</th></tr>'
+ templ = "\n<table class=\"body\">\n" + tab + "<tr>\n" + tab*2 + "<th>\n" \
+ + tab*3 + "Identified issues\n" + tab*2 + "</th>\n" + tab + "</tr>\n"
+ html = (tab*2).join(templ.splitlines(keepends=True))
for issue in sorted(issues):
- html += '<tr><td><a href="' + ISSUES_URI + '/' + issue + \
- '_issue.html">' + issue + '</a></td></tr>'
- html += '</table>'
- html += '<p>Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.</p>'
+ html += tab*3 + '<tr><td><a href="' + ISSUES_URI + '/' + issue + \
+ '_issue.html">' + issue + '</a></td></tr>\n'
+ html += tab*2 + '</table>\n'
+ html += tab*2 + '<p>Notes are stored in <a href="https://anonscm.debian.org/cgit/reproducible/notes.git">notes.git</a>.</p>'
title = 'Overview of known issues related to reproducible builds'
destfile = BASE + '/userContent/index_issues.html'
desturl = REPRODUCIBLE_URL + '/userContent/index_issues.html'