summaryrefslogtreecommitdiffstats
path: root/lib/python/web_support.py
diff options
context:
space:
mode:
authorHolger Levsen <holger@debian.org>2014-09-16 19:22:32 +0000
committerHolger Levsen <holger@debian.org>2014-09-16 19:22:32 +0000
commit0e05753b4cf26e4345b735a8b3d51b4578fc68b5 (patch)
treeda85cac2c8ee424f77aa64d2c6c77ff576649ab2 /lib/python/web_support.py
parent4b70d06716f8b456245f4bcc1f3c4026bab5d50b (diff)
web view: move H2 generation into make_table(), so empty tables won't
have a headline. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@28835 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/web_support.py')
-rw-r--r--lib/python/web_support.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py
index 2eabfaae1e..9d0c6a8771 100644
--- a/lib/python/web_support.py
+++ b/lib/python/web_support.py
@@ -443,7 +443,7 @@ def linkify(contents):
contents = re.sub(r'(httpS?://[\w.-]+/.*?)([,\s]|$)', _linkify, contents)
return contents
-def make_table(contents, caption=None, replacement=None, introduction=None):
+def make_table(contents, title=None, caption=None, replacement=None, introduction=None):
rows = []
for row in contents:
cols = []
@@ -457,9 +457,11 @@ def make_table(contents, caption=None, replacement=None, introduction=None):
cols.append(TD(col))
rows.append(Tag('tr', cols))
if rows:
- if introduction:
- return compose(introduction, TABLE(rows))
- return TABLE(rows)
+ if not introduction:
+ introduction=''
+ if not title:
+ title=''
+ return compose(title, introduction, TABLE(rows))
else:
return compose()

© 2014-2024 Faster IT GmbH | imprint | privacy policy