| Conditions | 2 |
| Total Lines | 19 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from html import escape as html_escape |
||
| 28 | def __init__(self): |
||
| 29 | super().__init__( |
||
| 30 | loader=jinja2.FileSystemLoader(searchpath=['templates']), |
||
| 31 | autoescape=True, |
||
| 32 | trim_blocks=True, |
||
| 33 | lstrip_blocks=True, |
||
| 34 | undefined=jinja2.StrictUndefined, |
||
| 35 | ) |
||
| 36 | |||
| 37 | @self.glob |
||
| 38 | def iterate(v): |
||
| 39 | if isinstance(v, Undefined): |
||
| 40 | return v |
||
| 41 | return h_iterate(v) |
||
| 42 | |||
| 43 | @self.filter |
||
| 44 | def bold(k): |
||
| 45 | return do_mark_safe( |
||
| 46 | tag(html_escape(k), "b") |
||
| 47 | ) |
||
| 55 |