[Piuparts-commits] [piuparts] 11/20: p-r: fix incorrect html

Holger Levsen holger at moszumanska.debian.org
Sat Nov 23 20:23:34 UTC 2013


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit fcb82c41e7b114e39d7389bad7d6ac4c3a7c8087
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Nov 9 18:36:49 2013 +0100

    p-r: fix incorrect html
    
    and improve formatting a bit
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog                       |  1 +
 htdocs/bug_howto.tpl                   |  1 -
 htdocs/style.css                       |  4 ++++
 master-bin/detect_well_known_errors.py | 10 +++++-----
 piuparts-report.py                     | 22 +++++++++++-----------
 5 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 17065ea..a3fe8e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ piuparts (0.56) UNRELEASED; urgency=low
   * piuparts-report.py:
     - Report URLs of all Packages files used for a section.
     - Avoid reporting duplicate dependencies after stripping versioning.
+    - Fix some invalid HTML constructs.
   * Improve exception handling.
   * known_problems: Upgrade adequate issue 'missing-copyright-file' from
     boring to normal and make pre_remove_50_find_missing_copyright no longer
diff --git a/htdocs/bug_howto.tpl b/htdocs/bug_howto.tpl
index 877ec89..bbf23fc 100644
--- a/htdocs/bug_howto.tpl
+++ b/htdocs/bug_howto.tpl
@@ -27,7 +27,6 @@
 	</pre>
 	This will make sure, piuparts.debian.org picks up your bug report (actually, it's piuparts-analyse.py) and marks it as <i>bugged</i> in the database.
      </td>
-     </td>
     </tr>
     <tr class="normalrow">
      <td class="contentcell2">
diff --git a/htdocs/style.css b/htdocs/style.css
index 9b3be56..9fb27ed 100644
--- a/htdocs/style.css
+++ b/htdocs/style.css
@@ -173,6 +173,10 @@ a.needs-bugging {
  background-color:#e0c0d0;
 }
 
+span.needs-bugging {
+ background-color:#e0c0d0;
+}
+
 #needs-bugging {
  background-color:#e0c0d0;
 }
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index 57f7869..15c1635 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -39,7 +39,7 @@ LOG_EXT = '.log'
 TPL_EXT = '.tpl'
 
 PROB_TPL = \
-"""<table class="righttable"><tr class="titlerow"><td class="titlecell">
+"""<tr class="titlerow"><td class="titlecell">
 $HEADER in $SECTION, sorted by reverse dependency count.
 </td></tr><tr class="normalrow"><td class="contentcell2">
 $HELPTEXT
@@ -49,11 +49,11 @@ COMMAND='$COMMAND'
 </td></tr><tr class="titlerow"><td class="alerttitlecell">Please file bugs!</td></tr><tr class="normalrow"><td class="contentcell2" colspan="3">
 <ul>
 $PACKAGE_LIST</ul>
-<p>Affected packages in $SECTION: $COUNT</p></td></tr></table>
+<p>Affected packages in $SECTION: $COUNT</p></td></tr>
 """
 
 UNKNOWN_TPL = \
-"""<table class="righttable"><tr class="titlerow"><td class="titlecell">
+"""<tr class="titlerow"><td class="titlecell">
 Packages with unknown failures detected in $SECTION, sorted by reverse dependency count.
 </td></tr><tr class="normalrow"><td class="contentcell2">
 <p>Please investigate and improve detection of known error types!</p>
@@ -61,7 +61,7 @@ Packages with unknown failures detected in $SECTION, sorted by reverse dependenc
 <ul>
 $PACKAGE_LIST
 </ul>
-<p>Affected packages in $SECTION: $COUNT</p></td></tr></table>
+<p>Affected packages in $SECTION: $COUNT</p></td></tr>
 """
 
 PKG_ERROR_TPL = \
@@ -386,7 +386,7 @@ def update_tpl(basedir, section, problem, failures, logdict, ftpl, ptpl, pkgsdb)
 
         if bugged_section is False and get_where(logdict[pkgspec]) != 'fail':
             bugged_section = True
-            pkg_text += "<br>\n"
+            pkg_text += "</ul><ul>\n"
 
         pkg_text += populate_tpl(ftpl, {
                                 'LOG': section_path(logdict[pkgspec]),
diff --git a/piuparts-report.py b/piuparts-report.py
index 43200b6..59f48af 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -31,7 +31,6 @@ import sys
 import time
 import logging
 import ConfigParser
-import urllib
 import shutil
 import re
 import string
@@ -55,8 +54,7 @@ DISTRO_CONFIG_FILE = "/etc/piuparts/distros.conf"
 
 PIUPARTS_VERSION = "__PIUPARTS_VERSION__"
 
-HTML_HEADER = """
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+HTML_HEADER = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!-- $content_md5 -->
  <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <!-- Generated by piuparts-report $piuparts_version -->
@@ -1045,8 +1043,8 @@ class Section:
         if binaryrows != "":
             source_state="unknown"
 
-            if success: source_state="<img src=\"%s/images/sunny.png\">" % self._doc_root
-            if failed:  source_state="<img src=\"%s/images/weather-severe-alert.png\">" % self._doc_root
+            if success: source_state="<img src=\"%s/images/sunny.png\" alt=\"success\">" % self._doc_root
+            if failed:  source_state="<img src=\"%s/images/weather-severe-alert.png\" alt=\"failed\">" % self._doc_root
 
             sourcerows =    "<tr class=\"titlerow\">" \
                           + "<td class=\"titlecell\" colspan=\"6\" id=\"%s\">%s in %s</td>" \
@@ -1175,9 +1173,9 @@ class Section:
 
 
     def create_and_link_to_analysises(self, state):
-        link="<ul>"
+        link="<ul>\n"
         for template, linktarget in linktarget_by_template:
-            # sucessful logs only have issues and failed logs only have errors
+            # successful logs only have issues and failed logs only have errors
             if (state == "failed-testing" and template[-9:] != "issue.tpl") \
                 or (state == "successfully-tested" and template[-9:] == "issue.tpl"):
                 substats = ""
@@ -1208,7 +1206,7 @@ class Section:
                             substats += sep + "%s affected" % count_affected
                             sep = ", "
                         if count_failed > 0:
-                            substats += sep + "<span id=\"needs-bugging\">%s failed</span>" % count_failed
+                            substats += sep + "<span class=\"needs-bugging\">%s failed</span>" % count_failed
                     else:
                         count_passed = string.count(rows, '"pass/')
                         if count_passed > 0:
@@ -1223,7 +1221,7 @@ class Section:
                     logging.debug("analysis template %s does not exist." % template)
 
         link += "</ul>"
-        if link == "<ul></ul>":
+        if link == "<ul>\n</ul>":
             link = ""
         return link
 
@@ -1320,18 +1318,20 @@ class Section:
                     vlist += "\n<ul>\n"
                     for alternatives in all_deps:
                         dep = alternatives[0]
-                        vlist += "<li>dependency %s is %s</li>\n" % \
+                        vlist += "<li>dependency %s is %s" % \
                                   (self.link_to_state_page(self._config.section, dep, dep),
                                   emphasize_reason(html_protect(self._binary_db.get_package_state(dep, resolve_virtual=False))))
                         vlist += self._show_providers(dep)
                         if len(alternatives) > 1:
                             vlist += "\n<ul>\n"
                             for dep in alternatives[1:]:
-                                vlist += "<li>alternative dependency %s is %s</li>\n" % \
+                                vlist += "<li>alternative dependency %s is %s" % \
                                           (self.link_to_state_page(self._config.section, dep, dep),
                                           emphasize_reason(html_protect(self._binary_db.get_package_state(dep, resolve_virtual=False))))
                                 vlist += self._show_providers(dep)
+                                vlist += "</li>\n"
                             vlist += "</ul>\n"
+                        vlist += "</li>\n"
                     vlist += "</ul>\n"
                 vlist += "</li>\n"
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list