From 456eb8cb470a79a92d8ca96e396cfef747933705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 18 Aug 2013 18:40:52 +0200 Subject: [PATCH] Only match "rs"/"resend" on the start of a line, otherwise the wrong lines might be interpreted as resend requests (cherry picked from commit ae09a50) --- octoprint/util/comm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 32f66c76..87a001b4 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -692,7 +692,7 @@ class MachineCom(object): self._sendCommand("M105") tempRequestTimeout = getNewTimeout("communication") # resend -> start resend procedure from requested line - elif "resend" in line.lower() or "rs" in line: + elif line.lower().startswith("resend") or line.lower().startswith("rs"): self._handleResendRequest(line) ### Printing @@ -726,7 +726,7 @@ class MachineCom(object): self._sendCommand(self._commandQueue.get()) else: self._sendNext() - elif "resend" in line.lower() or "rs" in line: + elif line.lower().startswith("resend") or line.lower().startswith("rs"): self._handleResendRequest(line) except: self._logger.exception("Something crashed inside the serial connection loop, please report this in OctoPrint's bug tracker:")