aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/display/menu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-08-16 15:39:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-08-20 21:03:22 -0400
commitb2c78d71b05690c68e4e48e6bba0c7bdebf8814d (patch)
treea7f10f1233727fb260990ad23e3d6122b81620f0 /klippy/extras/display/menu.py
parent2caaaea9a4bdd55846cdcf24b0efba60bcdfbd51 (diff)
downloadkutter-b2c78d71b05690c68e4e48e6bba0c7bdebf8814d.tar.gz
kutter-b2c78d71b05690c68e4e48e6bba0c7bdebf8814d.tar.xz
kutter-b2c78d71b05690c68e4e48e6bba0c7bdebf8814d.zip
gcode: Remove "action_" commands from get_status() calls
Rename printer.gcode.action_emergency_stop() to action_emergency_stop(), printer.gcode.action_respond_info() to action_respond_info(), and printer.gcode.action_respond_error() to action_raise_error() in command templates. This simplifies the get_status() interface, as returning callable functions from that interface was confusing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/menu.py')
-rw-r--r--klippy/extras/display/menu.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/klippy/extras/display/menu.py b/klippy/extras/display/menu.py
index ae9209d1..3849eae2 100644
--- a/klippy/extras/display/menu.py
+++ b/klippy/extras/display/menu.py
@@ -7,7 +7,6 @@
import os, logging
from string import Template
from . import menu_keys
-from .. import gcode_macro
class sentinel:
@@ -722,13 +721,11 @@ class MenuManager:
def update_context(self, eventtime):
# menu default jinja2 context
- self.context = {
- 'printer': gcode_macro.GetStatusWrapper(self.printer, eventtime),
- 'menu': {
- 'eventtime': eventtime,
- 'back': self._action_back,
- 'exit': self._action_exit
- }
+ self.context = self.gcode_macro.create_template_context(eventtime)
+ self.context['menu'] = {
+ 'eventtime': eventtime,
+ 'back': self._action_back,
+ 'exit': self._action_exit
}
def stack_push(self, container):