Conditions | 2 |
Total Lines | 48 |
Code Lines | 37 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from datetime import date |
||
31 | def __init__(self): |
||
32 | super().__init__( |
||
33 | loader=jinja2.FileSystemLoader(searchpath=[TEMPLATES_DIRECTORY]), |
||
34 | autoescape=True, |
||
35 | trim_blocks=True, |
||
36 | lstrip_blocks=True, |
||
37 | undefined=jinja2.StrictUndefined, |
||
38 | ) |
||
39 | |||
40 | @self.glob |
||
41 | def iterate(v): |
||
42 | if isinstance(v, Undefined): |
||
43 | return v |
||
44 | return h_iterate(v) |
||
45 | |||
46 | @self.glob |
||
47 | def today(): |
||
48 | return date.today() |
||
49 | |||
50 | @self.filter |
||
51 | def bold(k): |
||
52 | return do_mark_safe( |
||
53 | tag(html_escape(str(k)), "b") |
||
54 | ) |
||
55 | |||
56 | @self.filter |
||
57 | def moneda_nacional(k): |
||
58 | return common.pesos(k) |
||
59 | |||
60 | @self.filter |
||
61 | def numero(k): |
||
62 | return common.numero(k) |
||
63 | |||
64 | @self.filter |
||
65 | def porcentaje(k): |
||
66 | return common.porcentaje(k) |
||
67 | |||
68 | @self.filter |
||
69 | def fecha(k): |
||
70 | return common.fecha(k) |
||
71 | |||
72 | @self.filter |
||
73 | def delta_tiempo(k): |
||
74 | return common.delta_tiempo(k) |
||
75 | |||
76 | @self.glob |
||
77 | def html_str(cdfi): |
||
78 | return cfdi_render.html_str(cdfi) |
||
79 | |||
86 |