diff --git a/.versioneer-lookup b/.versioneer-lookup index 5f1c73468..cc9665637 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -23,10 +23,10 @@ maintenance 1.3.8 da2c9632ea54fd1b3c8ae34f8f26bab29dbaf3c6 pep440-dev fix/.* 1.3.8 da2c9632ea54fd1b3c8ae34f8f26bab29dbaf3c6 pep440-dev improve/.* 1.3.8 da2c9632ea54fd1b3c8ae34f8f26bab29dbaf3c6 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.3.7rc4 +# staging/maintenance is currently the branch for preparation of 1.3.7rc5 # so is regressionfix/... -staging/maintenance 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev -regressionfix/.* 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev +staging/maintenance 1.3.7rc5 e5caa3d0bf77ed23f04c1d96ab0fa997d19d2006 pep440-dev +regressionfix/.* 1.3.7rc5 e5caa3d0bf77ed23f04c1d96ab0fa997d19d2006 pep440-dev # every other branch is a development branch and thus gets resolved to 1.4.0-dev for now .* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev diff --git a/AUTHORS.md b/AUTHORS.md index 773a6c45e..217571c66 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -88,6 +88,8 @@ date of first contribution): * [Josh Major](https://github.com/astateofblank) * ["alex-gh"](https://github.com/alex-gh) * [Bernd Zeimetz](https://github.com/bzed) + * [Daniele Forsi](https://github.com/dforsi) + * [Ganey](https://github.com/ganey) 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/CHANGELOG.md b/CHANGELOG.md index a1bb98327..963eb5425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # OctoPrint Changelog +## 1.3.7rc4 (2018-04-04) + +### Bugfixes + + * [#2536](https://github.com/foosel/OctoPrint/issues/2536) - Fix a wrong state tracking when starting an SD print through the controller, causing a disconnect due to a timeout. + * [#2544](https://github.com/foosel/OctoPrint/issues/2544) - Fix an exception when connecting to the raw websocket at `/sockjs/websocket` (instead of `/sockjs///websocket`). + * [#2546](https://github.com/foosel/OctoPrint/issues/2546) - Fix the `PRINT_FAILED` event getting triggered twice on print failure due to disconnect + +([Commits](https://github.com/foosel/OctoPrint/compare/1.3.7rc3...1.3.7rc4)) + ## 1.3.7rc3 (2018-03-29) ### Bugfixes diff --git a/SUPPORTERS.md b/SUPPORTERS.md index de67c9adb..1de21d611 100644 --- a/SUPPORTERS.md +++ b/SUPPORTERS.md @@ -6,8 +6,6 @@ thanks to everyone who contributed! ## Patreon Patrons - * 3D Moniak - * Aleph Objects, Inc. * Andrew Moorby * Arnljot Arntsen * Boris Hussein @@ -32,6 +30,7 @@ thanks to everyone who contributed! * Kale Stedman * Kazuhiro Ogura * Kodama Inc. + * LulzBot® * Makespace Madrid * Mark Walker * Martin Beattie @@ -55,4 +54,4 @@ thanks to everyone who contributed! * Thomas Hatley * Trent Shumay -and 1214 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)! \ No newline at end of file +and 1217 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)! \ No newline at end of file diff --git a/docs/api/datamodel.rst b/docs/api/datamodel.rst index 9c423adc1..a55554e9e 100644 --- a/docs/api/datamodel.rst +++ b/docs/api/datamodel.rst @@ -263,8 +263,11 @@ File information - Path to type of file in extension tree. E.g. ``["model", "stl"]`` for ``.stl`` files, or ``["machinecode", "gcode"]`` for ``.gcode`` files. ``["folder"]`` for folders. -Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value -see "Files". +Additional properties depend on ``type``. +For a ``type`` value of ``folder``, see :ref:`Folders `. +For any other value see :ref:`Files `. + +.. _sec-api-datamodel-files-folders: Folders ''''''' @@ -287,6 +290,8 @@ Folders - Number - The size of all files contained in the folder and its subfolders. Not present in non recursive listings! +.. _sec-api-datamodel-files-files: + Files ''''' @@ -384,14 +389,58 @@ GCODE analysis information - 0..1 - Object - The estimated usage of filament - * - ``filament.length`` + * - ``filament.tool{n}.length`` - 0..1 - Integer - The length of filament used, in mm - * - ``filament.volume`` + * - ``filament.tool{n}.volume`` - 0..1 - Float - The volume of filament used, in cm³ + * - ``dimensions`` + - 0..1 + - Object + - Information regarding the size of the printed model + * - ``dimensions.depth`` + - 0..1 + - Float + - The depth of the printed model, in mm + * - ``dimensions.height`` + - 0..1 + - Float + - The height of the printed model, in mm + * - ``dimensions.width`` + - 0..1 + - Float + - The width of the printed model, in mm + * - ``printingArea`` + - 0..1 + - Object + - Information regarding the size of the printing area + * - ``printingArea.maxX`` + - 0..1 + - Float + - The maximum X coordinate of the printed model, in mm + * - ``printingArea.maxY`` + - 0..1 + - Float + - The maximum Y coordinate of the printed model, in mm + * - ``printingArea.maxZ`` + - 0..1 + - Float + - The maximum Z coordinate of the printed model, in mm + * - ``printingArea.minX`` + - 0..1 + - Float + - The minimum X coordinate of the printed model, in mm + * - ``printingArea.minY`` + - 0..1 + - Float + - The minimum Y coordinate of the printed model, in mm + * - ``printingArea.minZ`` + - 0..1 + - Float + - The minimum Z coordinate of the printed model, in mm .. _sec-api-datamodel-files-ref: @@ -420,4 +469,3 @@ References - URL - The model from which this file was generated (e.g. an STL, currently not used). Never present for folders. - diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index e31219da1..41e0fae69 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -893,7 +893,7 @@ Use the following settings to configure the serial connection to the printer: supportResendsWithoutOk: false # Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and - # the responds skips on the ok) + # the response skips on the ok) triggerOkForM29: true capabilities: diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index 234e25090..21c4657af 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -1443,7 +1443,7 @@ class SettingsPlugin(OctoPrintPlugin): Make sure to protect sensitive information stored by your plugin that only logged in administrators (or users) should have access to via :meth:`~octoprint.plugin.SettingsPlugin.get_settings_restricted_paths`. OctoPrint will - return its settings on the REST API even to anonymous clients, but will filter out fields it know are restricted, + return its settings on the REST API even to anonymous clients, but will filter out fields it knows are restricted, therefore you **must** make sure that you specify sensitive information accordingly to limit access as required! """ diff --git a/src/octoprint/plugins/cura/templates/snippets/settings/cura/profileImporter.jinja2 b/src/octoprint/plugins/cura/templates/snippets/settings/cura/profileImporter.jinja2 index c2aee1663..ddf48eb2b 100644 --- a/src/octoprint/plugins/cura/templates/snippets/settings/cura/profileImporter.jinja2 +++ b/src/octoprint/plugins/cura/templates/snippets/settings/cura/profileImporter.jinja2 @@ -52,7 +52,7 @@ {% trans %} You can import your existing profile .ini files from Cura 15.04.x or older - here. Anything but those are not supported. That especiallymeans that .json + here. Anything but those are not supported. That especially means that .json profiles from Cura 15.06.x and .curaprofile profiles from Cura 2.x will not work, and neither will custom Cura profile formats that third party tools like e.g. Repetier create. {% endtrans %} diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index f219186ae..54ae3cb92 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -333,7 +333,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, raise ValueError("Either URL or path must be provided") self._logger.info("Installing plugin from {}".format(source)) - pip_args = ["install", sarge.shell_quote(source)] + pip_args = ["install", sarge.shell_quote(source), '--no-cache-dir'] if dependency_links or self._settings.get_boolean(["dependency_links"]): pip_args.append("--process-dependency-links") diff --git a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 b/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 index 57ec4151c..5506dff4a 100644 --- a/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 +++ b/src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2 @@ -2,6 +2,6 @@
- {{ _('Make sure you have read "Using Release Channels" before switching to a release channel other than "Stable"', url="https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels") }} + {{ _('Make sure you have read "How to use the release channels to help test release candidates" before switching to a release channel other than "Stable"', url="https://faq.octoprint.org/using-release-channels") }}
diff --git a/src/octoprint/plugins/virtual_printer/virtual.py b/src/octoprint/plugins/virtual_printer/virtual.py index 3862e455a..d4f7cc260 100644 --- a/src/octoprint/plugins/virtual_printer/virtual.py +++ b/src/octoprint/plugins/virtual_printer/virtual.py @@ -29,6 +29,7 @@ class VirtualPrinter(object): prepare_ok_regex = re.compile("prepare_ok (.*)") send_regex = re.compile("send (.*)") set_ambient_regex = re.compile("set_ambient ([-+]?[0-9]*\.?[0-9]+)") + start_sd_regex = re.compile("start_sd (.*)") def __init__(self, seriallog_handler=None, read_timeout=5.0, write_timeout=10.0): import logging @@ -266,6 +267,10 @@ class VirtualPrinter(object): while self.incoming is not None and not self._killed: self._simulateTemps() + if self._heatingUp: + time.sleep(1) + continue + try: data = self.incoming.get(timeout=0.01) self.incoming.task_done() @@ -729,6 +734,13 @@ class VirtualPrinter(object): sleep_after_next | Sleeps s after execution of next + # SD printing + + start_sd + | Start printing file from SD + cancel_sd + | Cancels an ongoing SD print + # Misc send @@ -765,6 +777,13 @@ class VirtualPrinter(object): elif data == "go_awol": self._send("// Going AWOL") self._debug_awol = True + elif data == "cancel_sd": + if self._sdPrinting and self._sdPrinter: + self._pauseSdPrint() + self._sdPrinting = False + self._sdPrintingSemaphore.set() + self._sdPrinter.join() + self._finishSdPrint() else: try: sleep_match = VirtualPrinter.sleep_regex.match(data) @@ -774,6 +793,7 @@ class VirtualPrinter(object): prepare_ok_match = VirtualPrinter.prepare_ok_regex.match(data) send_match = VirtualPrinter.send_regex.match(data) set_ambient_match = VirtualPrinter.set_ambient_regex.match(data) + start_sd_match = VirtualPrinter.start_sd_regex.match(data) if sleep_match is not None: interval = int(sleep_match.group(1)) @@ -802,6 +822,9 @@ class VirtualPrinter(object): elif set_ambient_match is not None: self._ambient_temperature = float(set_ambient_match.group(1)) self._send("// set ambient temperature to {}".format(self._ambient_temperature)) + elif start_sd_match is not None: + self._selectSdFile(start_sd_match.group(1)) + self._startSdPrint() except: pass @@ -953,7 +976,7 @@ class VirtualPrinter(object): matchE = re.search("E([0-9.]+)", line) matchF = re.search("F([0-9.]+)", line) - duration = 0 + duration = 0.0 if matchF is not None: try: self._lastF = float(matchF.group(1)) @@ -1022,6 +1045,7 @@ class VirtualPrinter(object): pass if duration: + duration *= 0.1 if duration > self._read_timeout: slept = 0 while duration - slept > self._read_timeout and not self._killed: @@ -1119,9 +1143,9 @@ class VirtualPrinter(object): # set target temps if 'M104' in line or 'M109' in line: - self._parseHotendCommand(line) + self._parseHotendCommand(line, wait='M109' in line) elif 'M140' in line or 'M190' in line: - self._parseBedCommand(line) + self._parseBedCommand(line, wait='M190' in line) elif line.startswith("G0") or line.startswith("G1") or line.startswith("G2") or line.startswith("G3"): # simulate reprap buffered commands via a Queue with maxsize which internally simulates the moves self.buffered.put(line) @@ -1130,6 +1154,9 @@ class VirtualPrinter(object): if self.outgoing is not None: raise + self._finishSdPrint() + + def _finishSdPrint(self): if not self._killed: self._sdPrintingSemaphore.clear() self._selectedSdFilePos = 0 diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index b85f4e501..d11e47ffc 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -1176,7 +1176,8 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): def on_comm_print_job_failed(self): payload = self._payload_for_print_job_event() - eventManager().fire(Events.PRINT_FAILED, payload) + if payload: + eventManager().fire(Events.PRINT_FAILED, payload) def on_comm_print_job_cancelling(self, firmware_error=None): payload = self._payload_for_print_job_event() diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index 92d6fa9f2..788d7620d 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -223,6 +223,7 @@ class Server(object): # monkey patch some stuff util.sockjs.fix_tornado5_compatibility() + util.tornado.fix_json_encode() util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")]) # setup app diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py index c3538a158..d67a0fd35 100644 --- a/src/octoprint/server/util/sockjs.py +++ b/src/octoprint/server/util/sockjs.py @@ -151,15 +151,7 @@ class ThreadSafeSession(sockjs.tornado.session.Session): class JsonEncodingSessionWrapper(wrapt.ObjectProxy): - def send_message(self, msg, stats=True, binary=False): - """Send or queue outgoing message - - `msg` - Message to send - `stats` - If set to True, will update statistics after operation completes - """ self.send_jsonified(json.dumps(sockjs.tornado.util.bytes_to_str(msg), separators=(',', ':'), default=JsonEncoding.encode), @@ -168,7 +160,8 @@ class JsonEncodingSessionWrapper(wrapt.ObjectProxy): class PrinterStateConnection(sockjs.tornado.SockJSConnection, octoprint.printer.PrinterCallback): def __init__(self, printer, fileManager, analysisQueue, userManager, eventManager, pluginManager, session): - session = JsonEncodingSessionWrapper(session) + if isinstance(session, sockjs.tornado.session.Session): + session = JsonEncodingSessionWrapper(session) sockjs.tornado.SockJSConnection.__init__(self, session) diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py index dd56dc2dc..3ec1624a2 100644 --- a/src/octoprint/server/util/tornado.py +++ b/src/octoprint/server/util/tornado.py @@ -26,6 +26,22 @@ import octoprint.util +def fix_json_encode(): + """ + This makes tornado.escape.json_encode use octoprint.util.JsonEncoding.encode as fallback in order to allow + serialization of globally registered types like frozendict and others. + """ + + from octoprint.util.json import JsonEncoding + import json + + def fixed_json_encode(value): + return json.dumps(value, default=JsonEncoding.encode).replace(" + + + + diff --git a/src/octoprint/templates/navbar/login.jinja2 b/src/octoprint/templates/navbar/login.jinja2 index 370ed299b..c3bcdade0 100644 --- a/src/octoprint/templates/navbar/login.jinja2 +++ b/src/octoprint/templates/navbar/login.jinja2 @@ -6,6 +6,7 @@
+ {{ _('Forgot password?') }}