Merge branch 'staging/maintenance' into maintenance

This commit is contained in:
Gina Häußge committed 2018-04-04 12:36:24 +02:00
commit 9c31fa88a5
17 files changed
+89 -42

No files matched your search

+3 -3
View File
@@ -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
+10
View File
@@ -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/<server_id>/<session_id>/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
+2 -3
View File
@@ -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)!
and 1217 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
@@ -2,6 +2,6 @@
<label class="control-label">{{ _('OctoPrint Release Channel') }}</label>
<div class="controls">
<select data-bind="value: config_releaseChannel, options: config_availableReleaseChannels, optionsText: 'name', optionsValue: 'key'"></select>
<span class="help-inline">{{ _('Make sure you have read <a href="%(url)s" target="_blank" rel="noreferrer noopener">"Using Release Channels"</a> before switching to a release channel other than "Stable"', url="https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels") }}</span>
<span class="help-inline">{{ _('Make sure you have read <a href="%(url)s" target="_blank" rel="noreferrer noopener">"How to use the release channels to help test release candidates"</a> before switching to a release channel other than "Stable"', url="https://faq.octoprint.org/using-release-channels") }}</span>
</div>
</div>
@@ -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 <str:command> <int:seconds>
| Sleeps <seconds> s after execution of next <command>
# SD printing
start_sd <str:file>
| Start printing file <file> from SD
cancel_sd
| Cancels an ongoing SD print
# Misc
send <str:message>
@@ -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
+2 -1
View File
@@ -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()
+1
View File
@@ -223,6 +223,7 @@ class Server(object):
# monkey patch a bunch of stuff
util.sockjs.fix_tornado5_compatibility()
util.tornado.fix_json_encode()
util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")])
# setup app
+2 -9
View File
@@ -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)
+16
View File
@@ -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("</", "<\\/")
import tornado.escape
tornado.escape.json_encode = fixed_json_encode
#~~ More sensible logging
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2018-03-23 15:23+0100\n"
"PO-Revision-Date: 2018-03-23 15:25+0100\n"
"POT-Creation-Date: 2018-04-03 17:40+0200\n"
"PO-Revision-Date: 2018-04-03 17:40+0200\n"
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
"Language: de\n"
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\n"
@@ -1536,8 +1536,8 @@ msgstr "OctoPrint Release Channel"
#: src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2:5
#, python-format
msgid "Make sure you have read <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"Using Release Channels\"</a> before switching to a release channel other than \"Stable\""
msgstr "Stelle sicher, dass du <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"Using Release Channels\"</a> gelesen hast, bevor du einen anderen Release Channel als \"Stable\" auswählst."
msgid "Make sure you have read <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"How to use the release channels to help test release candidates\"</a> before switching to a release channel other than \"Stable\""
msgstr "Stelle sicher, dass du <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"How to use the release channels to help test release candidates\"</a> gelesen hast, bevor du einen anderen Release Channel als \"Stable\" auswählst."
#: src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/versionTracking.jinja2:2
msgid "OctoPrint version tracking"
+1 -1
View File
@@ -979,7 +979,7 @@ def thaw_frozendict(obj):
# only true love can thaw a frozen dict
letitgo = dict()
for key, value in obj.items():
if isinstance(value, frozendict.frozendict):
if isinstance(value, (dict, frozendict.frozendict)):
letitgo[key] = thaw_frozendict(value)
else:
letitgo[key] = copy.deepcopy(value)
+7 -9
View File
@@ -850,7 +850,6 @@ class MachineCom(object):
self._monitoring_active = False
self._send_queue_active = False
printing = self.isPrinting() or self.isPaused()
if self._serial is not None:
if not is_error:
self.sendGcodeScript("beforePrinterDisconnected")
@@ -883,6 +882,7 @@ class MachineCom(object):
self._logger.exception("Error while trying to close serial port")
is_error = True
# if we are printing, this will also make sure of firing PRINT_FAILED
if is_error:
self._changeState(self.STATE_CLOSED_WITH_ERROR)
else:
@@ -894,9 +894,6 @@ class MachineCom(object):
if settings().getBoolean(["feature", "sdSupport"]):
self._sdFileList = []
if printing:
self._callback.on_comm_print_job_failed()
def setTemperatureOffset(self, offsets):
self._tempOffsets.update(offsets)
@@ -1003,7 +1000,7 @@ class MachineCom(object):
if self._currentFile is None:
raise ValueError("No file selected for printing")
self._heatupWaitStartTime = None
self._heatupWaitStartTime = None if not self._heating else time.time()
self._heatupWaitTimeLost = 0.0
self._pauseWaitStartTime = 0
self._pauseWaitTimeLost = 0.0
@@ -1633,7 +1630,7 @@ class MachineCom(object):
if not disable_external_heatup_detection and not self._temperature_autoreporting \
and not line.strip().startswith("ok") and not self._heating \
and self._firmware_info_received:
self._logger.debug("Externally triggered heatup detected")
self._logger.info("Externally triggered heatup detected")
self._heating = True
self._heatupWaitStartTime = time.time()
@@ -2060,9 +2057,10 @@ class MachineCom(object):
self._trigger_error(error_text, "autodetect_baudrate")
def _finish_heatup(self):
if self._heatupWaitStartTime:
self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime)
self._heatupWaitStartTime = None
if self._heating:
if self._heatupWaitStartTime:
self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime)
self._heatupWaitStartTime = None
self._heating = False
def _continue_sending(self):
+1
View File
@@ -52,6 +52,7 @@ class MiscTestCase(unittest.TestCase):
(frozendict(a=1, b=2, c=frozendict(c1=1, c2=2)), dict(a=1, b=2, c=dict(c1=1, c2=2))),
(dict(a=1, b=2, c=3), dict(a=1, b=2, c=3)),
(dict(a=1, b=2, c=frozendict(c1=1, c2=2)), dict(a=1, b=2, c=dict(c1=1, c2=2))),
(dict(a=1, b=2, c=dict(c1=1, c2=2, c3=frozendict(c11=11, c12=12))), dict(a=1, b=2, c=dict(c1=1, c2=2, c3=dict(c11=11, c12=12))))
)
@ddt.unpack
def test_unfreeze_frozendict(self, input, expected):
Binary file not shown.
+4 -4
View File
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2018-03-23 15:23+0100\n"
"PO-Revision-Date: 2018-03-23 15:25+0100\n"
"POT-Creation-Date: 2018-04-03 17:40+0200\n"
"PO-Revision-Date: 2018-04-03 17:40+0200\n"
"Last-Translator: Gina Häußge <osd@foosel.net>\n"
"Language: de\n"
"Language-Team: German (http://www.transifex.com/projects/p/octoprint/language/de/)\n"
@@ -1536,8 +1536,8 @@ msgstr "OctoPrint Release Channel"
#: src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/releaseChannel.jinja2:5
#, python-format
msgid "Make sure you have read <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"Using Release Channels\"</a> before switching to a release channel other than \"Stable\""
msgstr "Stelle sicher, dass du <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"Using Release Channels\"</a> gelesen hast, bevor du einen anderen Release Channel als \"Stable\" auswählst."
msgid "Make sure you have read <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"How to use the release channels to help test release candidates\"</a> before switching to a release channel other than \"Stable\""
msgstr "Stelle sicher, dass du <a href=\"%(url)s\" target=\"_blank\" rel=\"noreferrer noopener\">\"How to use the release channels to help test release candidates\"</a> gelesen hast, bevor du einen anderen Release Channel als \"Stable\" auswählst."
#: src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/versionTracking.jinja2:2
msgid "OctoPrint version tracking"
+5 -4
View File
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OctoPrint 1.3.7rc2.dev16+g47267abcd.dirty\n"
"Project-Id-Version: OctoPrint 1.3.7rc4.dev6+g2c77614b3.dirty\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2018-03-23 15:23+0100\n"
"POT-Creation-Date: 2018-04-03 17:40+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1709,8 +1709,9 @@ msgstr ""
#, python-format
msgid ""
"Make sure you have read <a href=\"%(url)s\" target=\"_blank\" "
"rel=\"noreferrer noopener\">\"Using Release Channels\"</a> before "
"switching to a release channel other than \"Stable\""
"rel=\"noreferrer noopener\">\"How to use the release channels to help "
"test release candidates\"</a> before switching to a release channel other"
" than \"Stable\""
msgstr ""
#: src/octoprint/plugins/softwareupdate/templates/snippets/plugins/softwareupdate/versionTracking.jinja2:2