From 8092ff7e6220559376a5550102065c6ceaa934df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 4 Mar 2015 20:35:10 +0100 Subject: [PATCH] Workaround a bug in old versions of Marlin For some versions, the ok for a file delete message is not prepended by a newline: "File Deleted:ok" This work around will make it still detectable. --- src/octoprint/util/comm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index ef39c8eb..8d64057a 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -953,6 +953,10 @@ class MachineCom(object): pass elif 'Done saving file' in line: self.refreshSdFiles() + elif 'File deleted' in line and line.strip().endswith("ok"): + # buggy Marlin version that doesn't send a proper \r after the "File deleted" statement, fixed in + # current versions + self._clear_to_send.set() ##~~ Message handling elif line.strip() != '' \