Merge branch 'staging/maintenance' into maintenance

# Conflicts:
#	src/octoprint/server/util/sockjs.py
This commit is contained in:
Gina Häußge committed 2020-07-29 12:21:17 +02:00
commit c57c2b5a2b
8 files changed
+52 -24

No files matched your search

+3 -3
View File
@@ -24,10 +24,10 @@ maintenance 1.4.2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
fix/.* 1.4.2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
improve/.* 1.4.2 42769dad7dda3bc0c6c94e0e8ce832af9b14a565 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.4.1rc4
# staging/maintenance is currently the branch for preparation of 1.4.1rc5
# so is regressionfix/...
staging/maintenance 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
regressionfix/.* 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
staging/maintenance 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
regressionfix/.* 1.4.1rc5 458ab91f915307857941f839a1b743430b8786a4 pep440-dev
# staging/devel is currently inactive (but has the 1.4.1rc4 namespace)
staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev
+1 -2
View File
@@ -17,7 +17,6 @@ thanks to everyone who contributed!
* D Brian Kimmel
* DeltaMaker 3D Printers
* Dennis Breining
* Dorian Gray
* Eric Betts
* Ernesto Martinez
* Franziska Kunsmann
@@ -66,4 +65,4 @@ thanks to everyone who contributed!
* Sven Mueller
* Ulrich Kempken
and 1886 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
and 1932 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [Github Sponsors](https://github.com/users/foosel/sponsorship)!
@@ -13,8 +13,8 @@ from octoprint.util.version import get_octoprint_version_string, is_released_oct
from flask import jsonify
from flask_babel import gettext
SENTRY_URL_SERVER = "https://829e2245ec4d4693a0b708523004c4eb@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://fcbbcf95f5514b59866c5e7360fba1fe@o118517.ingest.sentry.io/1374096"
SENTRY_URL_SERVER = "https://912dd511a2274c6f99705d926c2b5126@o118517.ingest.sentry.io/1373987"
SENTRY_URL_COREUI = "https://572ed52f42d241c484db1c741e3c131e@o118517.ingest.sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False,
@@ -268,7 +268,7 @@
<small class="prop" data-bind="visible: $data.stats !== undefined" title="{{ _('Active instances past month')|edq }}"><i class="fa fa-server"></i> <span data-bind="text: $data.stats !== undefined ? formatNumberK($data.stats.instances_month) : 0"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.stars !== undefined" title="{{ _('Github stars')|edq }}"><i class="fa fa-star"></i> <span data-bind="text: ($data.github !== undefined && $data.github.stars !== undefined) ? formatNumberK($data.github.stars) : 0"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.last_push !== undefined" title="{{ _('Last push to main branch')|edq }}"><i class="fa fa-refresh"></i> <span data-bind="text: ($data.github !== undefined && $data.github.last_push !== undefined) ? $data.github.last_push.substring(0, 10) : ''"></span></small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
<small class="prop" data-bind="visible: $data.github !== undefined && $data.github.latest_release != undefined && $data.github.latest_release.tag && $data.github.latest_release.date" title="{{ _('Latest release & date')|edq }}"><i class="fa fa-tag"></i> <span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.tag ? $data.github.latest_release.tag : ''"></span> (<span data-bind="text: $data.github !== undefined && $data.github.latest_release !== undefined && $data.github.latest_release.date ? $data.github.latest_release.date.substring(0, 10) : ''"></span>)</small>
</div>
</div>
+1
View File
@@ -267,6 +267,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log")
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)
self._comm.start()
def disconnect(self, *args, **kwargs):
"""
+6 -1
View File
@@ -63,7 +63,12 @@ def _create_lastmodified(path, recursive):
return max(lms)
else:
storage, path_in_storage = path.split("/", 1)
if "/" in path:
storage, path_in_storage = path.split("/", 1)
else:
storage = path
path_in_storage = None
try:
return fileManager.last_modified(storage, path=path_in_storage, recursive=recursive)
except Exception:
+1
View File
@@ -242,6 +242,7 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection,
delta = self._last_current + self._base_rate_limit * self._throttle_factor - now
if delta > 0:
self._held_back_current = threading.Timer(delta, lambda: self.on_printer_send_current_data(data))
self._held_back_current.start()
return
self._last_current = now
+37 -15
View File
@@ -650,12 +650,17 @@ class MachineCom(object):
self._monitoring_active = True
self.monitoring_thread = threading.Thread(target=self._monitor, name="comm._monitor")
self.monitoring_thread.daemon = True
self.monitoring_thread.start()
# sending thread
self._send_queue_active = True
self.sending_thread = threading.Thread(target=self._send_loop, name="comm.sending_thread")
self.sending_thread.daemon = True
def start(self):
# doing this here instead of __init__ combats a race condition where
# self._comm in the printer interface is still None on first pushs from
# the comm layer during detection
self.monitoring_thread.start()
self.sending_thread.start()
def __del__(self):
@@ -993,15 +998,17 @@ 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:
self._changeState(self.STATE_CLOSED)
else:
deactivate_monitoring_and_send_queue()
self._serial = None
# if we are printing, this will also make sure of firing PRINT_FAILED
if is_error:
self._changeState(self.STATE_CLOSED_WITH_ERROR)
else:
self._changeState(self.STATE_CLOSED)
if settings().getBoolean(["feature", "sdSupport"]):
self._sdFileList = []
@@ -1682,6 +1689,10 @@ class MachineCom(object):
self._changeState(self.STATE_DETECT_SERIAL)
self._perform_detection_step(init=True)
if not self._state in (self.STATE_CONNECTING, self.STATE_DETECT_SERIAL):
# we got cancelled during connection, bail
return
# Start monitoring the serial port
self._log("Connected to: %s, starting monitor" % self._serial)
@@ -2438,19 +2449,30 @@ class MachineCom(object):
self._detection_candidates))))
def attempt_handshake():
timeout = self._get_communication_timeout_interval()
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = self._ok_timeout = monotonic_time() + timeout
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry + 1, timeout))
self._detection_retry += 1
self._do_send_without_checksum(b"", log=False) # new line to reset things
self.sayHello(tags={"trigger:detection", })
timeout = self._get_communication_timeout_interval()
log("Handshake attempt #{} with timeout {}s".format(self._detection_retry, timeout))
try:
if self._serial.timeout != timeout:
self._serial.timeout = timeout
self._timeout = self._ok_timeout = monotonic_time() + timeout
except Exception:
self._log("Unexpected error while setting timeout {}: {}".format(timeout, get_exception_string()))
self._logger.exception("Unexpected error while setting timeout {}".format(timeout))
else:
self._do_send_without_checksum(b"", log=False) # new line to reset things
self.sayHello(tags={"trigger:detection", })
while len(self._detection_candidates) > 0 or self._detection_retry < self.DETECTION_RETRIES:
if self._state not in (self.STATE_DETECT_SERIAL,):
return
if self._detection_retry < self.DETECTION_RETRIES:
if self._serial is None:
self._detection_retry = self.DETECTION_RETRIES
continue
attempt_handshake()
return