From 8c9536f323b13bfc3f8db29eba1f395af32b049c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 17 Mar 2022 14:28:16 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=90=9B=20GCV:=20Send=20the=20final=20?= =?UTF-8?q?layer=20to=20the=20UI=20as=20well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4463 --- .../plugins/gcodeviewer/static/js/viewer/worker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js index e0d4a6567..02492cfa1 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js @@ -709,12 +709,17 @@ var doParse = function () { } if (sendMultiLayer.indexOf(sendLayer) === -1) { - sendMultiLayer[sendMultiLayer.length] = sendLayer; + sendMultiLayer.push(sendLayer); } sendLayer = undefined; } } + + // we are done, send the final layer + if (sendMultiLayer.indexOf(activeLayer) === -1) { + sendMultiLayer.push(activeLayer); + } sendLayersToParent(sendMultiLayer, 100); }; From 7bc2a79642db98aa7a3f4477fe1cedeaec22a74e Mon Sep 17 00:00:00 2001 From: Zack Lewis <1774764+lima3w@users.noreply.github.com> Date: Thu, 17 Mar 2022 17:32:24 -0500 Subject: [PATCH 2/6] :pencil2: Spelling correction in software update docs (#4466) * Spelling Correction supplyting -> supplying * Update AUTHORS.md --- AUTHORS.md | 1 + docs/bundledplugins/softwareupdate.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 5cf6f796c..e325c6982 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -150,6 +150,7 @@ date of first contribution): * [Ben Sycha](https://github.com/Sycha) * [Bryan Kenote](https://github.com/bryankenote) * [Quinn Damerell](https://github.com/QuinnDamerell) + * [Zack Lewis](https://github.com/lima3w) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/docs/bundledplugins/softwareupdate.rst b/docs/bundledplugins/softwareupdate.rst index 574770f2b..c0a089eb8 100644 --- a/docs/bundledplugins/softwareupdate.rst +++ b/docs/bundledplugins/softwareupdate.rst @@ -551,7 +551,7 @@ Global credentials .. versionadded:: 1.5.0 -Starting with OctoPrint 1.5.0, the Software Update Plugin supports supplyting a GitHub +Starting with OctoPrint 1.5.0, the Software Update Plugin supports supplying a GitHub API token to use for the ``github_release`` and ``github_commit`` version check types, to work around possible rate limit problems if a lot of checks are to be made from a single external IP. You may create a `personal access token `_ From 6728a174486eb29d2f393414f312324775be107d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 22 Mar 2022 12:07:59 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=9A=B8=20Re-enable=20connect=20dialog?= =?UTF-8?q?=20w/=20no=20serial=20ports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently disabling it if no serial ports are currently known to the client breaks certain workflows for people. So this is a short-term solution to fix things for them, while technically non-sensical (why offer to connect if we don't see anything to connect to?) So in 1.9.0 this should rather be solved by adding some form of platform agnostic (!) auto-refresh, either regular polling while no port is detected, or even watchdog enabled event based refresh. See #4473. --- src/octoprint/static/js/app/viewmodels/connection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/connection.js b/src/octoprint/static/js/app/viewmodels/connection.js index 1bd6b0d98..664c30918 100644 --- a/src/octoprint/static/js/app/viewmodels/connection.js +++ b/src/octoprint/static/js/app/viewmodels/connection.js @@ -40,7 +40,8 @@ $(function () { self.isLoading = ko.observable(undefined); self.enableConnect = ko.pureComputed(function () { - return self.enablePort() || !self.isErrorOrClosed(); + //return self.enablePort() || !self.isErrorOrClosed(); + return true; // enable always for now, until we have an auto refresh in 1.9.0 }); self.buttonText = ko.pureComputed(function () { From 34e935bd0b94b9c46007192e52bcfe715eefb87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 22 Mar 2022 17:09:21 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=90=9B=20GCV:=20Moves=20may=20be=20ar?= =?UTF-8?q?cs=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4471 --- .../plugins/gcodeviewer/static/js/viewer/renderer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/renderer.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/renderer.js index f09c5d360..317e33da1 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/renderer.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/renderer.js @@ -1042,7 +1042,14 @@ GCODE.renderer = (function () { if (renderOptions["showMoves"] && !isNotCurrentLayer) { // move => draw line from (prevX, prevY) to (x, y) in move color ctx.lineWidth = lineWidthFactor; - ctx.lineTo(x, y); + + if (cmd.direction !== undefined && cmd.direction !== 0) { + var arc = getArcParams(cmd); + var ccw = cmd.direction < 0; // Y-axis is inverted so direction is also inverted + ctx.arc(arc.x, arc.y, arc.r, arc.startAngle, arc.endAngle, ccw); + } else { + ctx.lineTo(x, y); + } } } else if (cmd.extrude) { if (cmd.retract == 0) { From 772f9f95da25839dadcc8e3036abd986fc5788af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 23 Mar 2022 10:23:18 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=93=8C=20pre-commit:=20Pin=20flake8?= =?UTF-8?q?=20bugbear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new version will cause pre-commit to fail, we need to fix the newly detected issues but not on frozen code (like master or to a degree the RCs). --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26e4d5b16..0f25d2818 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-bugbear + - flake8-bugbear==22.1.11 - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.1.2 hooks: From 37bc8741315847d8d417f59aaa107927bb01dbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 23 Mar 2022 10:55:12 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20pre-commit:=20upgrade?= =?UTF-8?q?=20flake8-bugbear=20&=20fix=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- src/octoprint/plugin/types.py | 2 +- src/octoprint/server/util/watchdog.py | 3 +-- src/octoprint/server/views.py | 4 ++-- src/octoprint/util/comm.py | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 169d23636..7675171e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==22.1.11 + - flake8-bugbear==22.3.20 - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.5.1 hooks: diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index b43982670..b5e7979c1 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -1428,7 +1428,7 @@ class BlueprintPlugin(OctoPrintPlugin, RestartNeedingPlugin): # we now iterate over all members of ourselves and look if we find an attribute # that has data originating from one of our decorators - we ignore anything # starting with a _ to only handle public stuff - for member in [member for member in dir(self) if not member.startswith("_")]: + for member in [x for x in dir(self) if not x.startswith("_")]: f = getattr(self, member) if hasattr(f, "_blueprint_rules") and member in f._blueprint_rules: diff --git a/src/octoprint/server/util/watchdog.py b/src/octoprint/server/util/watchdog.py index aa36d8fe6..4424c19d5 100644 --- a/src/octoprint/server/util/watchdog.py +++ b/src/octoprint/server/util/watchdog.py @@ -41,8 +41,7 @@ class GcodeWatchdogHandler(watchdog.events.PatternMatchingEventHandler): """Recursively yield DirEntry objects for given directory.""" for entry in os.scandir(path): if entry.is_dir(follow_symlinks=False): - for entry in _recursive_scandir(entry.path): - yield entry + yield from _recursive_scandir(entry.path) else: yield entry diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 235e15f01..26e31ae17 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -150,9 +150,9 @@ def _valid_status_for_cache(status_code): return 200 <= status_code < 400 -def _add_additional_assets(hook): +def _add_additional_assets(hook_name): result = [] - for name, hook in pluginManager.get_hooks(hook).items(): + for name, hook in pluginManager.get_hooks(hook_name).items(): try: assets = hook() if isinstance(assets, (tuple, list)): diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 9677002ae..92b525600 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2593,7 +2593,7 @@ class MachineCom: ) for key in [ - key for key in parsed if key.startswith("e") and len(key) > 1 + x for x in parsed if x.startswith("e") and len(x) > 1 ]: setattr(self.last_position, key, parsed.get(key))