gcode: Exit if a shutdown occurs while running in batch mode

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-09-27 10:05:11 -04:00
parent f37fc775e5
commit 8d04d3d8fd
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,8 @@ class GCodeParser:
self.gcode_handlers = self.build_handlers(is_ready)
if not is_ready:
# Printer is shutdown (could be running in a background thread)
if self.is_fileinput:
self.printer.request_exit()
return
# Lookup printer components
self.toolhead = self.printer.objects.get('toolhead')