mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-10-26 00:36:08 +02:00
virtual_sdcard: Move shutdown debugging to "klippy:analyze_shutdown" event
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -16,8 +16,6 @@ DEFAULT_ERROR_GCODE = """
|
||||
class VirtualSD:
|
||||
def __init__(self, config):
|
||||
self.printer = config.get_printer()
|
||||
self.printer.register_event_handler("klippy:shutdown",
|
||||
self.handle_shutdown)
|
||||
# sdcard state
|
||||
sd = config.get('path')
|
||||
self.sdcard_dirname = os.path.normpath(os.path.expanduser(sd))
|
||||
@@ -46,7 +44,9 @@ class VirtualSD:
|
||||
self.gcode.register_command(
|
||||
"SDCARD_PRINT_FILE", self.cmd_SDCARD_PRINT_FILE,
|
||||
desc=self.cmd_SDCARD_PRINT_FILE_help)
|
||||
def handle_shutdown(self):
|
||||
self.printer.register_event_handler("klippy:analyze_shutdown",
|
||||
self._handle_analyze_shutdown)
|
||||
def _handle_analyze_shutdown(self, msg, details):
|
||||
if self.work_timer is not None:
|
||||
self.must_pause_work = True
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user