From b5f40cfd693a94816f50c90b18c25b54de819b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 11 Feb 2016 10:27:07 +0100 Subject: [PATCH 1/3] Always read all available lines from stdout and stderr Should produce faster output. --- src/octoprint/util/pip.py | 44 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/octoprint/util/pip.py b/src/octoprint/util/pip.py index 217609b5..8c88f8eb 100644 --- a/src/octoprint/util/pip.py +++ b/src/octoprint/util/pip.py @@ -124,34 +124,34 @@ class PipCaller(object): all_stderr = [] try: while p.returncode is None: - line = p.stderr.readline(timeout=0.5) - if line: - line = self._convert_line(line) - self._log_stderr(line) - all_stderr.append(line) + lines = p.stderr.readlines(timeout=0.5) + if lines: + lines = self._convert_lines(lines) + self._log_stderr(*lines) + all_stderr += lines - line = p.stdout.readline(timeout=0.5) - if line: - line = self._convert_line(line) - self._log_stdout(line) - all_stdout.append(line) + lines = p.stdout.readlines(timeout=0.5) + if lines: + lines = self._convert_lines(lines) + self._log_stdout(*lines) + all_stdout += lines p.commands[0].poll() finally: p.close() - stderr = p.stderr.text - if stderr: - split_lines = map(self._convert_line, stderr.split("\n")) - self._log_stderr(*split_lines) - all_stderr += split_lines + lines = p.stderr.readlines() + if lines: + lines = map(self._convert_line, lines) + self._log_stderr(*lines) + all_stderr += lines - stdout = p.stdout.text - if stdout: - split_lines = map(self._convert_line, stdout.split("\n")) - self._log_stdout(*split_lines) - all_stdout += split_lines + lines = p.stdout.readlines() + if lines: + lines = map(self._convert_line, lines) + self._log_stdout(*lines) + all_stdout += lines return p.returncode, all_stdout, all_stderr @@ -240,6 +240,10 @@ class PipCaller(object): def _log_stderr(self, *lines): self.on_log_stderr(*lines) + @staticmethod + def _convert_lines(lines): + return map(PipCaller._convert_line, lines) + @staticmethod def _convert_line(line): return to_unicode(_clean_ansi(line), errors="replace") From fe134e79864cb27ee3cda3535722afbe8f301789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 12 Feb 2016 12:10:19 +0100 Subject: [PATCH 2/3] Added back the "test without plugins" clause to the bug reporting guide --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 684aa087..80f5773e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,9 @@ following section *completely*. Thank you! :) the people maintaining them instead. 2. Please make sure to **test out the current version** of OctoPrint to see - whether the problem you are encountering still exists. + whether the problem you are encountering still exists, and **test without + any non-bundled plugins enabled** to make sure it's not a misbehaving + plugin causing the issue at hand. If you are feeling up to it you might also want to try the current development version of OctoPrint (if you aren't already). Refer to the [FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ) From 0a3dc4b354813f4266e292eaa2c496f9174d1db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 15 Feb 2016 09:58:04 +0100 Subject: [PATCH 3/3] Fixed a bug that prevented the "Upload to SD" button from working Introduced with the bug fix for #1196 Closes #1224 --- src/octoprint/static/js/app/viewmodels/files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index f22e9fa0..304bc527 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -469,7 +469,7 @@ $(function() { self._enableSdDropzone = function(enable) { var options = { - url: API_BASEURL + "files/local", + url: API_BASEURL + "files/sdcard", dataType: "json", dropZone: enable ? self.sdTarget : null, done: self._handleUploadDone,