Coverage for khufu/tables/tr.py : 67%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
5def tr(
6 cellContent="",
7 color=False,
8 href=False,
9 popover=False,
10 span=False):
11 """
12 *Generate a table row - TBS style*
14 **Key Arguments**
16 - ``cellContent`` -- the content - either `<td>`s or `<th>`s
17 - ``color`` -- [ sucess | error | warning | info ]
18 - ``href`` -- add a link for the whole table row
21 **Return**
23 - ``tr`` -- the table row
25 """
27 if isinstance(cellContent, list):
28 new = ""
29 for c in cellContent:
30 new += c
31 cellContent = new
33 if color is False:
34 color = ""
36 if href is False:
37 href = ""
38 link = ""
39 else:
40 href = """href="%(href)s" """ % locals()
41 link = "link"
43 if popover is False:
44 popover = ""
46 if span is False:
47 span = ""
48 else:
49 span = "span%(span)s" % locals()
51 tr = """<tr %(href)s class="%(link)s %(color)s %(span)s" %(popover)s>%(cellContent)s</tr>""" % locals()
53 return tr