From 75f53b8ab96ec45c8395129d239b35b039785453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 22 May 2013 18:25:26 +0200 Subject: [PATCH] Properly parse Marlin's "opened file x" message --- 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 553d9c9..47153d5 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -565,8 +565,8 @@ class MachineCom(object): self._sdFileSize = int(match.group(2)) self._callback.mcProgress() elif 'File opened' in line: - # answer to M23, at least on Marlin, Repetier and Sprinter: "File opened: %s Size: %d" - match = re.search("File opened: (.*?) Size: ([0-9]*)", line) + # answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d" + match = re.search("File opened:\s*(.*?)\s+Size:\s*([0-9]*)", line) self._sdFile = match.group(1) self._sdFileSize = int(match.group(2)) elif 'File selected' in line: