diff options
Diffstat (limited to 'postgresqleu/confreg/jinjabadge.py')
| -rwxr-xr-x | postgresqleu/confreg/jinjabadge.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/postgresqleu/confreg/jinjabadge.py b/postgresqleu/confreg/jinjabadge.py index 63860d2c..ec4c9dc9 100755 --- a/postgresqleu/confreg/jinjabadge.py +++ b/postgresqleu/confreg/jinjabadge.py @@ -26,6 +26,7 @@ alignments = { 'right': TA_RIGHT, } + def get_color(col): if isinstance(col, unicode) or isinstance(col, str): return colors.getAllNamedColors().get(col) @@ -34,9 +35,11 @@ def get_color(col): else: raise Exception("Unknown color defintion type") + def getmm(struct, key): return struct[key] * mm + class JinjaBadge(Flowable): def __init__(self, js, imgpath): self.js = js @@ -146,9 +149,11 @@ def escapejson_filter(v): # those, but only one if there is more than one. return re.sub(r'^"|"$', '', json.dumps(v)) + def test_inlist(v, l): return v in l + class JinjaRenderer(object): def __init__(self, rootdir, debug=False, border=False, pagebreaks=False): self.templatedir = os.path.join(rootdir, 'templates') |
