From 02aad445aa952c8fe18b0315124cd49deac6055a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 30 Oct 2017 12:36:09 +0100 Subject: [PATCH 1/3] Hardening against system.actions = null See #2187 --- src/octoprint/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index b91449947..1ecec5710 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -1115,7 +1115,7 @@ class Settings(object): reboot="systemRestartCommand", restart="serverRestartCommand") - if "system" in config and "actions" in config["system"]: + if "system" in config and "actions" in config["system"] and isinstance(config["system"]["actions"], (list, tuple)): actions = config["system"]["actions"] to_delete = [] for index, spec in enumerate(actions): From caaaa2e4e96f989be073771c1d5af7a1b122b264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 30 Oct 2017 12:59:43 +0100 Subject: [PATCH 2/3] Fix temperature autoreport after external reset We didn't reset the capability flag and also didn't resend M155. Now we do at least the latter if we detected that the printer supports temperature auto reporting earlier. --- src/octoprint/util/comm.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 11551adb7..9a571bda8 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -954,7 +954,7 @@ class MachineCom(object): self._recordFilePosition() self._callback.on_comm_print_job_cancelled() - def cancelPrint(self, firmware_error=None): + def cancelPrint(self, firmware_error=None, disable_log_position=False): if not self.isOperational(): return @@ -987,7 +987,7 @@ class MachineCom(object): except: pass - if self._log_position_on_cancel: + if self._log_position_on_cancel and not disable_log_position: self.sendCommand("M400", on_sent=_on_M400_sent) else: self._cancel_preparation_done() @@ -1582,7 +1582,7 @@ class MachineCom(object): "Resetting line numbers to be on the safe side" self._log(message) self._logger.warn(message) - self.resetLineNumbers() + self._onExternalReset() else: verb = "streaming to SD" if self.isStreaming() else "printing" @@ -1590,7 +1590,8 @@ class MachineCom(object): "Aborting job since printer lost state.".format(verb) self._log(message) self._logger.warn(message) - self.cancelPrint() + self.cancelPrint(disable_log_position=True) + self._onExternalReset() eventManager().fire(Events.PRINTER_RESET) @@ -1804,6 +1805,12 @@ class MachineCom(object): eventManager().fire(Events.CONNECTED, payload) self.sendGcodeScript("afterPrinterConnected", replacements=dict(event=payload)) + def _onExternalReset(self): + self.resetLineNumbers() + + if self._temperature_autoreporting: + self._set_autoreport_temperature() + def _getTemperatureTimerInterval(self): busy_default = 4.0 target_default = 2.0 From 532ac0264dcc1be016ee04a536301f9f50647895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 1 Nov 2017 16:15:18 +0100 Subject: [PATCH 3/3] Force https index URL in requirements.txt Also an additional measure against #2193 --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 3175f72cd..3f4887daa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,6 @@ # variables INSTALL_REQUIRES and EXTRA_REQUIRES. ### +# let's force the regular pypi URL, with https, just to be sure +-i https://pypi.python.org/simple .