From 86fbbefb6eee016bb5d4fbe90d87e6c8b4768626 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 15 May 2016 09:16:53 -0500 Subject: [PATCH 1/3] Complete backport of pid cleanup fix for #1324 --- src/octoprint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index 67baa4f7..73081ea4 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -24,7 +24,7 @@ class Main(Daemon): self._logConf = logConf def run(self): - octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot) + octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot, self._logConf, self) octoprint.run() def main(): From 821fa4299b522f35ab7539b9d693769a03e43387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 19 May 2016 18:35:02 +0200 Subject: [PATCH 2/3] Let's go all in and use keyword parameters Way less error prone than positional arguments! --- src/octoprint/__init__.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index 73081ea4..df198672 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -24,7 +24,14 @@ class Main(Daemon): self._logConf = logConf def run(self): - octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot, self._logConf, self) + octoprint = Server(configfile=self._configfile, + basedir=self._basedir, + host=self._host, + port=self._port, + debug=self._debug, + allowRoot=self._allowRoot, + logConf=self._logConf, + octoprint_daemon=self) octoprint.run() def main(): @@ -77,7 +84,13 @@ def main(): elif "restart" == args.daemon: daemon.restart() else: - octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf) + octoprint = Server(configfile=args.config, + basedir=args.basedir, + host=args.host, + port=args.port, + debug=args.debug, + allowRoot=args.allowRoot, + logConf=args.logConf) octoprint.run() if __name__ == "__main__": From 801d60388a6290d7934dae16d5d3070c05b24458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 20 May 2016 10:24:47 +0200 Subject: [PATCH 3/3] Also report 0% print progress to plugins Fixes #1344 --- src/octoprint/printer/standard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index b6492bde..cb4a4a57 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -629,7 +629,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): printTimeLeft = totalPrintTime - cleanedPrintTime if (totalPrintTime is not None and cleanedPrintTime is not None) else None - if progress: + if progress is not None: progress_int = int(progress * 100) if self._lastProgressReport != progress_int: self._lastProgressReport = progress_int