diff --git a/.versioneer-lookup b/.versioneer-lookup index f897bb16c..7422f1293 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -18,21 +18,21 @@ prerelease HEAD \(detached.* -# maintenance is currently the branch for preparation of maintenance release 1.8.0 +# maintenance is currently the branch for preparation of maintenance release 1.9.0 # so are any fix/... and improve/... branches -maintenance 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev -fix/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev -improve/.* 1.8.0 3fe45661cd79c5137d9d4f5f4adb4d9519bc2084 pep440-dev +maintenance 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev +fix/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev +improve/.* 1.9.0 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev # staging/bugfix is the branch for preparation of the 1.7.4 bugfix release # so are any bug/... branches staging/bugfix 1.7.4 59cbfadf8922d85b9df40f8d0173e8c21724c3b8 pep440-dev bug/.* 1.7.4 59cbfadf8922d85b9df40f8d0173e8c21724c3b8 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.7.0rc4 +# staging/maintenance is currently the branch for preparation of 1.8.0rc1 # so is regressionfix/... -staging/maintenance 1.7.0rc4 f31194f75365787f3eb5da61a24f2f8620111f4f pep440-dev -regressionfix/.* 1.7.0rc4 f31194f75365787f3eb5da61a24f2f8620111f4f pep440-dev +staging/maintenance 1.8.0rc1 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev +regressionfix/.* 1.8.0rc1 fa2c4680cca0d1d6b46e6c1ed68ceea4d9b79afb pep440-dev # staging/devel is currently inactive (but has the 1.4.1rc4 namespace) staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev diff --git a/setup.py b/setup.py index aa896dd96..5b143e772 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ core_deps = [ "semantic_version>=2.8.5,<3", "sentry-sdk>=1.3.1,<2", "tornado>=6.0.4,<7", - "watchdog==1.0.0", + "watchdog>=1,<2", "websocket-client>=1.2.1,<2", "wrapt>=1.13.3,<1.14", "zeroconf>=0.33,<0.34", # breaking changes can happen on minor version increases diff --git a/src/octoprint/plugins/announcements/__init__.py b/src/octoprint/plugins/announcements/__init__.py index 149ee90b6..82ea66c2b 100644 --- a/src/octoprint/plugins/announcements/__init__.py +++ b/src/octoprint/plugins/announcements/__init__.py @@ -4,6 +4,7 @@ __copyright__ = "Copyright (C) 2016 The OctoPrint Project - Released under terms import calendar +import logging import os import re import threading @@ -436,9 +437,11 @@ class AnnouncementPlugin( self._logger.debug(f"Loaded channel {key} from cache at {channel_path}") return d except Exception: - self._logger.exception( - f"Could not read channel {key} from cache {channel_path}" - ) + if self._logger.isEnabledFor(logging.DEBUG): + self._logger.exception( + f"Could not read channel {key} from cache at {channel_path}" + ) + try: os.remove(channel_path) except OSError: diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js index de056f2f9..a4c1876d0 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js @@ -54,7 +54,7 @@ GCODE.gCodeReader = (function () { byteCount = 0; for (i = 0; i < lines.length; i++) { - byteCount += lines[i].length + 1; // line length + line ending + byteCount += lines[i].length + 1; // line length + '\n' gcode.push({line: lines[i], percentage: (byteCount * 100) / totalSize}); } lines = []; @@ -188,8 +188,21 @@ GCODE.gCodeReader = (function () { this.clear(); var totalSize = reader.target.result.length; - // With a regex split below as previous, memory usage is huge & takes longer. - lines = reader.target.result.replace("\r\n", "\n").split("\n"); + + /* + * Split by line ending + * + * Be aware that for windows line endings \r\n this leaves the \r attached to + * the lines. That will not influence our parser, but makes file position + * calculation way easier (line length + 1), so we just leave it in. + * + * This cannot cope with old MacOS \r line endings, but those should + * really not be used anymore and thus we'll happily ignore them here. + * + * Note: A simple string split uses up *much* less memory than regex. + */ + lines = reader.target.result.split("\n"); + reader.target.result = null; prepareGCode(totalSize);