Fix macro context creation

This commit is contained in:
Desuuuu 2020-08-29 18:18:42 +02:00
parent 98fbeb96c9
commit 41d9d00cfd
No known key found for this signature in database
GPG Key ID: 85943F4B2C2CE0DC
2 changed files with 4 additions and 7 deletions

View File

@ -74,9 +74,8 @@ class T5UID1_Routine:
self.reactor.update_timer(self._timer, self.reactor.NOW)
return
swrap = self._template.create_status_wrapper()
context = { 'printer': swrap,
'is_timer': is_timer }
context = self._template.create_template_context()
context['is_timer'] = is_timer
context.update(self._context)
result = self._template.render(context).strip()

View File

@ -85,8 +85,7 @@ class T5UID1_Var:
if self.type != "input":
raise Exception("not an input")
swrap = self._template.create_status_wrapper()
context = { 'printer': swrap }
context = self._template.create_template_context()
context.update(self._context)
if self.data_type != "none" and self.data_len != 0:
@ -118,8 +117,7 @@ class T5UID1_Var:
if self.type != "output":
raise Exception("not an output")
swrap = self._template.create_status_wrapper()
context = { 'printer': swrap }
context = self._template.create_template_context()
context.update(self._context)
result = self._template.render(context)