]> git.decadent.org.uk Git - dak.git/commitdiff
examine-package: make headline() functional
authorTorsten Werner <twerner@debian.org>
Tue, 6 Jul 2010 05:23:12 +0000 (05:23 +0000)
committerTorsten Werner <twerner@debian.org>
Tue, 6 Jul 2010 05:23:12 +0000 (05:23 +0000)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/examine_package.py

index 402e26cc1328273b4dc4e2a34d305d0efb5166ef..f7fadf2a4dc3777ef910262fc3df5778b43f8fc3 100755 (executable)
@@ -91,13 +91,13 @@ def escape_if_needed(s):
 def headline(s, level=2, bodyelement=None):
     if use_html:
         if bodyelement:
-            print """<thead>
+            return """<thead>
                 <tr><th colspan="2" class="title" onclick="toggle('%(bodyelement)s', 'table-row-group', 'table-row-group')">%(title)s <span class="toggle-msg">(click to toggle)</span></th></tr>
               </thead>"""%{"bodyelement":bodyelement,"title":utils.html_escape(s)}
         else:
-            print "<h%d>%s</h%d>" % (level, utils.html_escape(s), level)
+            return "<h%d>%s</h%d>" % (level, utils.html_escape(s), level)
     else:
-        print "---- %s ----" % (s)
+        return "---- %s ----" % (s)
 
 # Colour definitions, 'end' isn't really for use
 
@@ -157,7 +157,7 @@ def foldable_output(title, elementnameprefix, content, norow=False):
     if use_html:
         print """<div id="%(elementnameprefix)s-wrap"><a name="%(elementnameprefix)s" />
                    <table class="infobox rfc822">"""%d
-    headline(title, bodyelement="%(elementnameprefix)s-body"%d)
+    print headline(title, bodyelement="%(elementnameprefix)s-body"%d)
     if use_html:
         print """    <tbody id="%(elementnameprefix)s-body" class="infobody">"""%d
     if norow: