From ac4a0f772d49770c95d0d76124b31525f9b2c5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 9 Jun 2013 18:29:28 +0200 Subject: [PATCH] Fixed whitespace --- octoprint/util/comm.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 3a6ce59..80ecbdc 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -947,20 +947,20 @@ class MachineCom(object): line = line[0] if not self.isStreaming(): - try: - if matchesGcode(line, "M0") or matchesGcode(line, "M1"): - self.setPause(True) - line = "M105" # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause. - if self._printSection in self._feedRateModifier: - line = re.sub('F([0-9]*)', lambda m: 'F' + str(int(int(m.group(1)) * self._feedRateModifier[self._printSection])), line) - if (matchesGcode(line, "G0") or matchesGcode(line, "G1")) and 'Z' in line: - z = float(re.search('Z([0-9\.]*)', line).group(1)) - if self._currentZ != z: - self._currentZ = z - self._callback.mcZChange(z) - except: - self._log("Unexpected error: %s" % (getExceptionString())) - self._sendCommand(line, True) + try: + if matchesGcode(line, "M0") or matchesGcode(line, "M1"): + self.setPause(True) + line = "M105" # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause. + if self._printSection in self._feedRateModifier: + line = re.sub('F([0-9]*)', lambda m: 'F' + str(int(int(m.group(1)) * self._feedRateModifier[self._printSection])), line) + if (matchesGcode(line, "G0") or matchesGcode(line, "G1")) and 'Z' in line: + z = float(re.search('Z([0-9\.]*)', line).group(1)) + if self._currentZ != z: + self._currentZ = z + self._callback.mcZChange(z) + except: + self._log("Unexpected error: %s" % (getExceptionString())) + self._sendCommand(line, True) self._callback.mcProgress() def sendCommand(self, cmd):