aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--klippy/klippy.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py
index 4bfc2f63..becbe113 100644
--- a/klippy/klippy.py
+++ b/klippy/klippy.py
@@ -54,7 +54,7 @@ class Printer:
self.reactor = reactor.Reactor()
self.reactor.register_callback(self._connect)
self.state_message = message_startup
- self.is_shutdown = False
+ self.in_shutdown_state = False
self.run_result = None
self.event_handlers = {}
gc = gcode.GCodeParser(self, input_fd)
@@ -65,6 +65,8 @@ class Printer:
return self.reactor
def get_state_message(self):
return self.state_message
+ def is_shutdown(self):
+ return self.in_shutdown_state
def _set_state(self, msg):
if self.state_message in (message_ready, message_startup):
self.state_message = msg
@@ -188,10 +190,10 @@ class Printer:
logging.exception("Unhandled exception during post run")
return run_result
def invoke_shutdown(self, msg):
- if self.is_shutdown:
+ if self.in_shutdown_state:
return
logging.error("Transition to shutdown state: %s", msg)
- self.is_shutdown = True
+ self.in_shutdown_state = True
self._set_state("%s%s" % (msg, message_shutdown))
for cb in self.event_handlers.get("klippy:shutdown", []):
try: