From 6d1e28ae9ce3536cc33064f5312f684d258030a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Jan 2017 13:04:01 +0100 Subject: [PATCH] We still need _read_lines after all in the streamed file info --- 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 26655417..ae5a99c6 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2593,6 +2593,7 @@ class PrintingGcodeFileInformation(PrintingFileInformation): raise IOError("File %s does not exist" % self._filename) self._size = os.stat(self._filename).st_size self._pos = 0 + self._read_lines = 0 def seek(self, offset): with self._handle_mutex: @@ -2601,6 +2602,7 @@ class PrintingGcodeFileInformation(PrintingFileInformation): self._handle.seek(offset) self._pos = self._handle.tell() + self._read_lines = 0 def start(self): """ @@ -2617,6 +2619,7 @@ class PrintingGcodeFileInformation(PrintingFileInformation): # catching that. import codecs self._pos += len(codecs.BOM_UTF8) + self._read_lines = 0 def close(self): """ @@ -2661,6 +2664,7 @@ class PrintingGcodeFileInformation(PrintingFileInformation): if not line: self.close() processed = self._process(line, offsets, current_tool) + self._read_lines += 1 return processed except Exception as e: self.close()