Compare commits

...
16 Commits
Author SHA1 Message Date
Gina Häußge a8747f7e36 Fix a bug with release vs dev version detection 2017-12-08 15:09:58 +01:00
Gina Häußge 17e6f5d508 Preparing release of 1.3.6rc3 2017-12-07 17:40:04 +01:00
Gina Häußge 133a4658ee Switch to https for (plugins.)octoprint.org
Also add utm tags to the two support-octoprint links so we have a chance
to see if anyone ever actually clicks on those.
2017-12-07 16:35:01 +01:00
Gina Häußge 0a2e2ed297 Don't write default update type & method to config
If we set method to pip in 1.3.6 and then roll back to 1.3.5 we will
need to a manual config.yaml update otherwise or we will no longer be
able to update.

Be removing the force parameter and using the actual default settings
instead of current ones, we don't do that anymore.
2017-12-07 11:15:43 +01:00
Gina Häußge 6b41dbc12b staging is 1.3.6rc3.dev 2017-12-05 16:00:58 +01:00
Gina Häußge 3f4a70cf92 Prepare release of 1.3.6rc2 2017-12-05 12:34:55 +01:00
Gina Häußge 41eb9481b3 Fix offset values on API after setting one offset
Make sure to set the actual effective offsets as provided by the comm
layer (which merges incoming single offset adjustments) instead of only
setting the input, effectively nuking return of offsets set prior.

Closes #2268
2017-12-05 12:17:48 +01:00
Gina Häußge 743d590d52 model might not be set yet
So don't try to read its length right away.

Closes #2267
2017-12-05 10:54:33 +01:00
Gina Häußge 900e8a2aaf Docs: Fixed a typo 2017-12-05 10:40:20 +01:00
Gina Häußge 06816fb8dc Test: checksum missing => missing checksum 2017-12-04 16:04:38 +01:00
Gina Häußge cc0a17f2ac Unit tests for MachineCom._handle_errors
With various Marlin and Repetier error variants.
2017-12-04 15:56:31 +01:00
Gina Häußge 9b1b4420a3 Make error messages in virtual printer configurable
We want to be able to test various firmware variants for stuff like
checksum and line number mismatches...

See also #2262
2017-12-04 11:47:29 +01:00
Gina Häußge 263925625b resend_request_communication_errors was too narrow
Didn't match Marlin's "checksum mismatch", only Repetier's "checksum
error". Since the error handler checks against
recoverable_communication_errors before
resend_request_communication_errors, we can just switch back to the more
broader check against "checksum" for the latter.

We could also have added an explicit check for "checksum mismatch"
instead but since we used to check for "checksum" and we don't know what
other varieties for this specific error might be out there in the
thousands of firmware variants (who needs consistency when they can
have a free for all?), we'll err on the side of caution instead.

Fixes #2262
2017-12-04 11:10:06 +01:00
Gina Häußge f72dfb48e1 Fix ordering of plugin assets
Should be alphabetical per their identifier. As noticed by @BillyBlaze
2017-12-01 18:16:44 +01:00
Gina Häußge e064400900 Link to blacklist in wizard & settings
As suggested by @Kunsi in #2256
2017-12-01 17:47:16 +01:00
Gina Häußge 107954021b staging is 1.3.6rc2.dev 2017-12-01 16:05:06 +01:00
31 changed files with 1615 additions and 3552 deletions

No files matched your search

+3 -3
View File
@@ -22,10 +22,10 @@ maintenance 1.3.6 1a6dbb3f4a5bef857cdeb13c031b9deca2cf30a2 pep440-dev
fix/.* 1.3.6 1a6dbb3f4a5bef857cdeb13c031b9deca2cf30a2 pep440-dev
improve/.* 1.3.6 1a6dbb3f4a5bef857cdeb13c031b9deca2cf30a2 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.3.6rc1
# staging/maintenance is currently the branch for preparation of 1.3.6rc3
# so is regressionfix/...
staging/maintenance 1.3.6rc1 77753ca02602d3a798d6b0a22535e6fd69ff448a pep440-dev
regressionfix/.* 1.3.6rc1 77753ca02602d3a798d6b0a22535e6fd69ff448a pep440-dev
staging/maintenance 1.3.6rc3 3f4a70cf92a7d9081932850be1ea9fb298f0e3f7 pep440-dev
regressionfix/.* 1.3.6rc3 3f4a70cf92a7d9081932850be1ea9fb298f0e3f7 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
+24 -8
View File
@@ -1,15 +1,31 @@
# OctoPrint Changelog
## 1.3.6rc3 (2017-12-08)
### Improvements
* Fetch plugin blacklist (and also announcements, plugin notices and plugin repository) via https instead of http.
### Bug fixes
* Fixed an issue causing redundant software update configuration settings to be written to `config.yaml`, in turn causing issues when downgrading to <1.3.5
* Fixed an issue detecting whether the installed version is a release version or a development version.
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.6rc2...1.3.6rc3))
## 1.3.6rc2 (2017-12-05)
### Bug fixes
* [#2262](https://github.com/foosel/OctoPrint/issues/2262) - Fixed a bug causing `Error:checksum mismatch, Last Line: ...` errors from the firmware to be handled incorrectly.
* [#2267](https://github.com/foosel/OctoPrint/issues/2267) - Fixed a bug causing the GCODE viewer to not get properly initialized due to a JS error on load if "Also show next layer" was selected.
* [#2268](https://github.com/foosel/OctoPrint/issues/2268) - Fixed a bug causing a display error with the temperature offsets. If one offset was changed, all others seemed to revert back to 0.
* Fixed ordering of plugin assets, should be alphabetical based on the plugin identifier.
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.6rc1...1.3.6rc2))
## 1.3.6rc1 (2017-12-01)
### Note for upgraders and plugin authors: Change in the bundling of JS assets can lead to issues in plugins
A change to solve issues with plugins bundling JS assets that cause interference with other plugins (e.g. through the declaration of `"use strict"`) and in general to add better isolation and error handling might cause errors for some plugins that go beyond your run-off-the-mill view model and also implicitly declare new globals.
If you happen to run into any such issues, you can switch back to the old way of bundling JS assets via the newly introduced "Settings > Feature > Enable legacy plugin asset bundling" toggle (check it, save the settings, restart the server). This is provided to allow for a minimally invasive adjustment period until affected plugins have been updated.
You can find out more about the change, how to know if a plugin is even affected and what do about it [on the OctoBlog](http://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/).
### Improvements
* [#203](https://github.com/foosel/OctoPrint/issues/203) - Allow selecting the current tab via URL hashs. Also update URL hash when switching tabs, thus adding this to the browser history and allowing quicker back and forth navigation through the browser's back and forward buttons.
+1 -3
View File
@@ -38,14 +38,12 @@ thanks to everyone who contributed!
* Marcus Ackermann
* Mark Qvist
* Mark Walker
* Masayoshi Mitsui
* Michael Aumock
* Miles Flavel
* mitchell hirsch
* Mohammed khorakiwala
* Noe Ruiz
* Patrick McGinnis
* Peter Grace
* Peter Schmehl
* PRINT3Dforum.com
* Robert Gusek
@@ -61,4 +59,4 @@ thanks to everyone who contributed!
* Timeshell.ca
* Trent Shumay
and 1151 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
and 1143 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
+1 -1
View File
@@ -146,7 +146,7 @@ Out of the box, OctoPrint defaults to the following script setup for ``afterPrin
;disable all heaters
{% snippet 'disable_hotends' %}
[% snippet 'disable_bed' %}
{% snippet 'disable_bed' %}
;disable fan
M106 S0
+1 -1
View File
@@ -63,7 +63,7 @@ EXTRA_REQUIRES = dict(
# Dependencies for developing OctoPrint
develop=[
# Testing dependencies
"mock>=1.0.1,<1.1",
"mock>=2.0.0,<3",
"nose>=1.3.0,<1.4",
"ddt",
@@ -60,27 +60,27 @@ class AnnouncementPlugin(octoprint.plugin.AssetPlugin,
description="Important announcements about OctoPrint.",
priority=1,
type="rss",
url="http://octoprint.org/feeds/important.xml"),
url="https://octoprint.org/feeds/important.xml"),
_releases=dict(name="Release Announcements",
description="Announcements of new releases and release candidates of OctoPrint.",
priority=2,
type="rss",
url="http://octoprint.org/feeds/releases.xml"),
url="https://octoprint.org/feeds/releases.xml"),
_blog=dict(name="On the OctoBlog",
description="Development news, community spotlights, OctoPrint On Air episodes and more from the official OctoBlog.",
priority=2,
type="rss",
url="http://octoprint.org/feeds/octoblog.xml"),
url="https://octoprint.org/feeds/octoblog.xml"),
_plugins=dict(name="New Plugins in the Repository",
description="Announcements of new plugins released on the official Plugin Repository.",
priority=2,
type="rss",
url="http://plugins.octoprint.org/feed.xml"),
url="https://plugins.octoprint.org/feed.xml"),
_octopi=dict(name="OctoPi News",
description="News around OctoPi, the Raspberry Pi image including OctoPrint.",
priority=2,
type="rss",
url="http://octoprint.org/feeds/octopi.xml")),
url="https://octoprint.org/feeds/octopi.xml")),
enabled_channels=[],
forced_channels=["_important"],
channel_order=["_important", "_releases", "_blog", "_plugins", "_octopi"],
@@ -6,6 +6,11 @@
normal operation, allowing you to uninstall or update them to a newer version.
{% endtrans %}</p>
<p>{% trans url="https://plugins.octoprint.org/blacklist/" %}
By default, OctoPrint will use the blacklist hosted at <code>plugins.octoprint.org/blacklist.json</code> which you
can also take a look at in a more human readable format <a href="{{ url }}" target="_blank">here</a>.
{% endtrans %}</p>
<p>{% trans %}
Please decide whether to allow fetch and use of this centralized blacklist starting with the next server start.
You may also change your decision at any time through Settings > Server right from within OctoPrint.
@@ -5,7 +5,7 @@
<p>Version <span class="plugin_octopi_support_version">{{ plugin_octopi_support_version }}</span></p>
<ul>
<li>Website: <a href="http://octoprint.org/download/" target="_blank" rel="noreferrer noopener">octoprint.org/download</a> &amp; <a href="https://octopi.octoprint.org" target="_blank" rel="noreferrer noopener">octopi.octoprint.org</a></li>
<li>Website: <a href="https://octoprint.org/download/" target="_blank" rel="noreferrer noopener">octoprint.org/download</a> &amp; <a href="https://octopi.octoprint.org" target="_blank" rel="noreferrer noopener">octopi.octoprint.org</a></li>
<li>Source Code: <a href="https://github.com/guysoft/OctoPi" target="_blank" rel="noreferrer noopener">github.com/guysoft/OctoPi</a></li>
</ul>
@@ -117,9 +117,9 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
def get_settings_defaults(self):
return dict(
repository="http://plugins.octoprint.org/plugins.json",
repository="https://plugins.octoprint.org/plugins.json",
repository_ttl=24*60,
notices="http://plugins.octoprint.org/notices.json",
notices="https://plugins.octoprint.org/notices.json",
notices_ttl=6*60,
pip_args=None,
pip_force_user=False,
@@ -133,7 +133,7 @@
{{ pluginmanager_safemode() }}
{{ pluginmanager_offline() }}
<h4 style="position: relative">
{{ _('... from the <a href="%(url)s" target="_blank">Plugin Repository</a>', url='http://plugins.octoprint.org') }}
{{ _('... from the <a href="%(url)s" target="_blank">Plugin Repository</a>', url='https://plugins.octoprint.org') }}
<div class="dropdown pull-right">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<span class="fa fa-wrench"></span>
@@ -306,30 +306,10 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
if "notify_users" in data:
self._settings.set_boolean(["notify_users"], data["notify_users"])
checks = self._get_configured_checks()
if "octoprint" in checks:
check = checks["octoprint"]
update_type = check.get("type", None)
update_method = self._get_update_method("octoprint", check)
checkout_folder = check.get("checkout_folder", None)
update_folder = check.get("update_folder", None)
prerelease = check.get("prerelease", False)
prerelease_channel = check.get("prerelease_channel", None)
else:
update_type = update_method = checkout_folder = update_folder = prerelease_channel = None
prerelease = False
defaults = dict(
plugins=dict(softwareupdate=dict(
checks=dict(
octoprint=dict(
type=update_type,
method=update_method,
checkout_folder=checkout_folder,
update_folder=update_folder,
prerelease=prerelease,
prerelease_channel=prerelease_channel
)
octoprint=self.get_settings_defaults()["checks"]["octoprint"]
)
))
)
@@ -338,7 +318,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
if "octoprint_checkout_folder" in data:
self._settings.set(["checks", "octoprint", "checkout_folder"], data["octoprint_checkout_folder"], defaults=defaults, force=True)
if update_folder and data["octoprint_checkout_folder"]:
if self._settings.get(["checks", "octoprint", "update_folder"]) and data["octoprint_checkout_folder"]:
self._settings.set(["checks", "octoprint", "update_folder"], None, defaults=defaults, force=True)
updated_octoprint_check_config = True
@@ -346,13 +326,13 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
octoprint_type = data["octoprint_type"]
if octoprint_type == "github_release":
self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults, force=True)
self._settings.set(["checks", "octoprint", "method"], "pip", defaults=defaults, force=True)
self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults)
self._settings.set(["checks", "octoprint", "method"], "pip", defaults=defaults)
updated_octoprint_check_config = True
elif octoprint_type == "git_commit":
self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults, force=True)
self._settings.set(["checks", "octoprint", "method"], "update_script", defaults=defaults, force=True)
self._settings.set(["checks", "octoprint", "type"], octoprint_type, defaults=defaults)
self._settings.set(["checks", "octoprint", "method"], "update_script", defaults=defaults)
updated_octoprint_check_config = True
if "octoprint_release_channel" in data:
@@ -993,6 +973,8 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
if target == "octoprint":
from flask.ext.babel import gettext
from octoprint.util.version import is_released_octoprint_version, is_stable_octoprint_version
result["displayName"] = to_unicode(check.get("displayName"), errors="replace")
if result["displayName"] is None:
# displayName missing or set to None
@@ -1010,16 +992,16 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
stable_branch = check["stable_branch"]["branch"]
if "prerelease_branches" in check:
release_branches += [x["branch"] for x in check["prerelease_branches"]]
result["released_version"] = not release_branches or BRANCH in release_branches
result["released_version"] = is_released_octoprint_version()
if check["type"] in self.COMMIT_TRACKING_TYPES:
result["current"] = REVISION if REVISION else "unknown"
else:
result["current"] = VERSION
if check["type"] == "github_release" and (check.get("prerelease", None) or BRANCH != stable_branch):
# we are tracking github releases and are either also tracking prerelease OR are currently installed
# from something that is not the stable (master) branch => we need to change some parameters
if check["type"] == "github_release" and (check.get("prerelease", None) or not is_stable_octoprint_version()):
# we are tracking github releases and are either also tracking prerelease OR are currently running
# a non stable version => we need to change some parameters
# we compare versions fully, not just the base so that we see a difference
# between RCs + stable for the same version release
@@ -1039,17 +1021,9 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
result["update_branch"] = check.get("update_branch", stable_branch)
if check.get("update_script", None):
# we force an exact version
# we force an exact version & python unequality check, to be able to downgrade
result["force_exact_version"] = True
if BRANCH != result.get("prerelease_channel"):
# we force python unequality check here because that will also allow us to
# downgrade on a prerelease channel change (rc/devel => rc/maintenance)
#
# we detect channel changes by comparing the current branch with the target
# branch of the release channel - unequality means we might have to handle
# a downgrade
result["release_compare"] = "python_unequal"
result["release_compare"] = "python_unequal"
elif check.get("pip", None):
# we force python unequality check for pip installs, to be able to downgrade
@@ -66,6 +66,8 @@ class VirtualPrinter(object):
self._prepared_errors = []
self._errors = settings().get(["devel", "virtualPrinter", "errors"], merged=True)
self.currentExtruder = 0
self.extruderCount = settings().getInt(["devel", "virtualPrinter", "numExtruders"])
self.pinnedExtruders = settings().get(["devel", "virtualPrinter", "pinnedExtruders"])
@@ -146,8 +148,8 @@ class VirtualPrinter(object):
self._triggerResendAt100 = True
self._triggerResendWithTimeoutAt105 = True
self._triggeredResendWithTimeoutAt105 = False
self._triggerResendWithMissingLinenoAt110 = True
self._triggerResendWithChecksumMismatchAt115 = True
readThread = threading.Thread(target=self._processIncoming, name="octoprint.plugins.virtual_printer.wait_thread")
readThread.start()
@@ -227,7 +229,7 @@ class VirtualPrinter(object):
self.currentLine += 1
elif settings().getBoolean(["devel", "virtualPrinter", "forceChecksum"]):
self._send("Error: Missing checksum")
self._send(self._error("checksum_missing"))
continue
# track N = N + 1
@@ -261,7 +263,11 @@ class VirtualPrinter(object):
continue
elif linenumber == 110 and self._triggerResendWithMissingLinenoAt110 and not self._writingToSd:
self._triggerResendWithMissingLinenoAt110 = False
self._send("Error: No Line Number with checksum, Last Line: {}".format(self.lastN))
self._send(self._error("lineno_missing", self.lastN))
continue
elif linenumber == 115 and self._triggerResendWithChecksumMismatchAt115 and not self._writingToSd:
self._triggerResendWithChecksumMismatchAt115 = False
self._triggerResend(checksum=True)
continue
elif len(self._prepared_errors):
prepared = self._prepared_errors.pop(0)
@@ -355,7 +361,7 @@ class VirtualPrinter(object):
self._send("echo:changed F value")
return False
else:
self._send("Error: Unknown command F")
self._send(self._error("command_unknown", "F"))
return True
def _gcode_M104(self, data):
@@ -549,11 +555,11 @@ class VirtualPrinter(object):
if actual is None:
if checksum:
self._send("Error: Wrong checksum")
self._send(self._error("checksum_mismatch"))
else:
self._send("Error: Missing checksum")
self._send(self._error("checksum_missing"))
else:
self._send("Error: expected line %d got %d" % (expected, actual))
self._send(self._error("lineno_mismatch", expected, actual))
def request_resend():
self._send("Resend:%d" % expected)
@@ -636,11 +642,13 @@ class VirtualPrinter(object):
elif data == "trigger_missing_checksum":
self._prepared_errors.append(lambda cur, last, line: self._triggerResend(expected=last, checksum=False))
elif data == "trigger_missing_lineno":
self._prepared_errors.append(lambda cur, last, line: self._send("Error: No Line Number with checksum, Last Line: {}".format(last)))
self._prepared_errors.append(lambda cur, last, line: self._send(self._error("lineno_missing", last)))
elif data == "drop_connection":
self._debug_drop_connection = True
elif data == "mintemp_error":
self._send(self._error("mintemp"))
elif data == "maxtemp_error":
self._send("Error: MAXTEMP triggered!")
self._send(self._error("maxtemp"))
elif data == "go_awol":
self._send("// Going AWOL")
self._debug_awol = True
@@ -1182,6 +1190,9 @@ class VirtualPrinter(object):
return ok.format(ok, lastN=self.lastN, buffer=self.buffered.maxsize - self.buffered.qsize())
def _error(self, error, *args, **kwargs):
return "Error: {}".format(self._errors.get(error).format(*args, **kwargs))
class CharCountingQueue(queue.Queue):
def __init__(self, maxsize, name=None):
+1 -1
View File
@@ -367,7 +367,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
return
self._comm.setTemperatureOffset(offsets)
self._setOffsets(offsets)
self._setOffsets(self._comm.getOffsets())
def _convert_rate_value(self, factor, min=0, max=200):
if not isinstance(factor, (int, float, long)):
+3 -3
View File
@@ -15,7 +15,7 @@ from flask.ext.assets import Environment, Bundle
from babel import Locale
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from collections import defaultdict
from collections import defaultdict, OrderedDict
from builtins import bytes, range
from past.builtins import basestring
@@ -1268,7 +1268,7 @@ class Server(object):
# TODO remove again in 1.3.8
def js_bundles_for_plugins(collection, filters=None):
"""Produces Bundle instances"""
result = dict()
result = OrderedDict()
for plugin, assets in collection.items():
if len(assets):
result[plugin] = Bundle(*assets, filters=filters)
@@ -1277,7 +1277,7 @@ class Server(object):
else:
def js_bundles_for_plugins(collection, filters=None):
"""Produces JsPluginBundle instances that output IIFE wrapped assets"""
result = dict()
result = OrderedDict()
for plugin, assets in collection.items():
if len(assets):
result[plugin] = JsPluginBundle(plugin, *assets, filters=filters)
+8 -6
View File
@@ -28,6 +28,8 @@ import octoprint.server
import octoprint.users
import octoprint.plugin
from octoprint.util import DefaultOrderedDict
from werkzeug.contrib.cache import BaseCache
from past.builtins import basestring
@@ -1348,12 +1350,12 @@ def collect_plugin_assets(enable_gcodeviewer=True, preferred_stylesheet="css"):
logger = logging.getLogger(__name__ + ".collect_plugin_assets")
supported_stylesheets = ("css", "less")
assets = dict(bundled=dict(js=collections.defaultdict(list),
css=collections.defaultdict(list),
less=collections.defaultdict(list)),
external=dict(js=collections.defaultdict(list),
css=collections.defaultdict(list),
less=collections.defaultdict(list)))
assets = dict(bundled=dict(js=DefaultOrderedDict(list),
css=DefaultOrderedDict(list),
less=DefaultOrderedDict(list)),
external=dict(js=DefaultOrderedDict(list),
css=DefaultOrderedDict(list),
less=DefaultOrderedDict(list)))
asset_plugins = octoprint.plugin.plugin_manager().get_implementations(octoprint.plugin.AssetPlugin)
for implementation in asset_plugins:
+11 -2
View File
@@ -159,7 +159,7 @@ default_settings = {
},
"pluginBlacklist": {
"enabled": None,
"url": "http://plugins.octoprint.org/blacklist.json",
"url": "https://plugins.octoprint.org/blacklist.json",
"ttl": 15 * 60 # 15 min
},
"diskspace": {
@@ -389,7 +389,16 @@ default_settings = {
"capabilities": {
"AUTOREPORT_TEMP": True
},
"ambientTemperature": 21.3
"ambientTemperature": 21.3,
"errors": {
"checksum_mismatch": "Checksum mismatch",
"checksum_missing": "Missing checksum",
"lineno_mismatch": "expected line {} got {}",
"lineno_missing": "No Line Number with checksum, Last Line: {}",
"maxtemp": "MAXTEMP triggered!",
"mintemp": "MINTEMP triggered!",
"command_unknown": "Unknown command {}"
}
}
}
}
@@ -69,7 +69,7 @@ GCODE.renderer = (function(){
ctx.clearRect(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);
drawGrid();
drawBoundingBox();
if(renderOptions['showNextLayer'] && layerNumStore < model.length - 1) {
if (renderOptions['showNextLayer'] && model && model.length && layerNumStore < model.length - 1) {
drawLayer(layerNumStore + 1, 0, GCODE.renderer.getLayerNumSegments(layerNumStore + 1), true);
}
if (renderOptions['showPreviousLayer'] && layerNumStore > 0) {
@@ -5,14 +5,14 @@
<p>Version <span class="version">{{ display_version }}</span></p>
<ul>
<li>Website: <a href="http://octoprint.org" target="_blank" rel="noreferrer noopener">octoprint.org</a></li>
<li>Website: <a href="https://octoprint.org" target="_blank" rel="noreferrer noopener">octoprint.org</a></li>
<li>Source Code: <a href="https://github.com/foosel/OctoPrint" target="_blank" rel="noreferrer noopener">github.com/foosel/OctoPrint</a></li>
<li>Documentation: <a href="http://docs.octoprint.org" target="_blank" rel="noreferrer noopener">docs.octoprint.org</a></li>
</ul>
<p>
<strong>Development of OctoPrint wouldn't be possible without <a href="javascript:void(0)" data-bind="click: function() { showTab('{{ templates.about.entries.supporters[1]._div }}'); }">its supporters</a>.</strong><br>
If you enjoy OctoPrint, please consider <a href="http://octoprint.org/support-octoprint/" target="_blank" rel="noreferrer noopener">supporting its ongoing development</a>.
If you enjoy OctoPrint, please consider <a href="https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=about_dialog" target="_blank" rel="noreferrer noopener">supporting its ongoing development</a>.
</p>
<p>
@@ -3,7 +3,7 @@
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: feature_legacyPluginAssets" id="settings-legacyPluginAssets"> {{ _('Enable legacy plugin asset bundling') }} <span class="label label-info">Compatibility</span>
<span class="help-block">{% trans url="http://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/" %}
<span class="help-block">{% trans url="https://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/" %}
Enable this, save and restart your server if you are running into issues with plugins with OctoPrint
1.3.6 or later that used to work with OctoPrint up to version 1.3.5. See <a href="{{ url }}">here</a>
for details on why this is happening. Note that this legacy flag will be removed in a future
@@ -17,7 +17,7 @@
<h4>{{ _('If you enjoy OctoPrint...') }}</h4>
<span style="display: inline-block; float: left; font-size: 4em; margin-right: .3em"><img src="{{ url_for('static', filename='img/tentacle-56x56.png') }}"></span>
<p>{% trans url='http://octoprint.org/support-octoprint/' %}
<p>{% trans url='https://octoprint.org/support-octoprint/?utm_source=octoprint&utm_medium=first_run_wizard' %}
Please consider to <strong><a href="{{ url }}" target="_blank">support OctoPrint's ongoing development</a></strong>,
which can only continue with funding by users like you! You can also find this link in the "About" dialog.<br>
<strong>Thank you!</strong>
+1 -1
View File
@@ -114,7 +114,7 @@
<li><small>{{ _('OctoPrint') }} <span class="version">{{ display_version|e }}</span></small></li>
</ul>
<ul id="footer_links" class="pull-right">
<li><a href="http://octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fa fa-home"></i> {{ _('Homepage') }}</a></li>
<li><a href="https://octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fa fa-home"></i> {{ _('Homepage') }}</a></li>
<li><a href="https://github.com/foosel/OctoPrint/" target="_blank" rel="noreferrer noopener"><i class="fa fa-github"></i> {{ _('Source') }}</a></li>
<li><a href="http://docs.octoprint.org" target="_blank" rel="noreferrer noopener"><i class="fa fa-book"></i> {{ _('Docs') }}</a></li>
<li><a href="https://github.com/foosel/OctoPrint/issues" target="_blank" rel="noreferrer noopener"><i class="fa fa-flag"></i> {{ _('Issues') }}</a></li>
@@ -3,3 +3,8 @@
the use of a centralized plugin version blacklist to automatically disable such plugins before they can interfere
with normal operation.
{% endtrans %}</p>
<p>{% trans url="https://plugins.octoprint.org/blacklist/" %}
By default, OctoPrint will use the blacklist hosted at <code>plugins.octoprint.org/blacklist.json</code> which you
can also take a look at in a more human readable format <a href="{{ url }}" target="_blank">here</a>.
{% endtrans %}</p>
File diff suppressed because it is too large. Load diff
+46
View File
@@ -20,6 +20,7 @@ import threading
from functools import wraps
import warnings
import contextlib
import collections
try:
import queue
@@ -737,6 +738,51 @@ def dict_filter(dictionary, filter_function):
return dict((k, v) for k, v in dictionary.items() if filter_function(k, v))
# Source: http://stackoverflow.com/a/6190500/562769
class DefaultOrderedDict(collections.OrderedDict):
def __init__(self, default_factory=None, *a, **kw):
if default_factory is not None and not callable(default_factory):
raise TypeError('first argument must be callable')
collections.OrderedDict.__init__(self, *a, **kw)
self.default_factory = default_factory
def __getitem__(self, key):
try:
return collections.OrderedDict.__getitem__(self, key)
except KeyError:
return self.__missing__(key)
def __missing__(self, key):
if self.default_factory is None:
raise KeyError(key)
self[key] = value = self.default_factory()
return value
def __reduce__(self):
if self.default_factory is None:
args = tuple()
else:
args = self.default_factory,
return type(self), args, None, None, self.items()
def copy(self):
return self.__copy__()
def __copy__(self):
return type(self)(self.default_factory, self)
def __deepcopy__(self, memo):
import copy
return type(self)(self.default_factory,
copy.deepcopy(self.items()))
# noinspection PyMethodOverriding
def __repr__(self):
return 'OrderedDefaultDict(%s, %s)' % (self.default_factory,
collections.OrderedDict.__repr__(self))
class Object(object):
pass
+14 -12
View File
@@ -1953,18 +1953,20 @@ class MachineCom(object):
return False
_resend_request_communication_errors = ("line number",
"wrong checksum",
"missing checksum",
"format error",
"expected line")
_recoverable_communication_errors = ("no line number with checksum",)
_sd_card_errors = ("volume.init",
"openroot",
"workdir",
"error writing to file",
"cannot open",
"cannot enter")
_recoverable_communication_errors = ("no line number with checksum",)
_resend_request_communication_errors = ("line number", # since this error class get's checked after recoverable
# communication errors, we can use this broad term here
"checksum", # since this error class get's checked after recoverable
# communication errors, we can use this broad term here
"format error",
"expected line")
_sd_card_errors = ("volume.init",
"openroot",
"workdir",
"error writing to file",
"cannot open",
"open failed",
"cannot enter")
def _handle_errors(self, line):
if line is None:
return
+57
View File
@@ -46,6 +46,63 @@ def get_octoprint_version(base=False):
return octoprint_version
def is_released_octoprint_version(version=None):
"""
>>> import pkg_resources
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.6rc3"))
True
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.6rc3.dev2+g1234"))
False
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.6"))
True
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.6.post1+g1234"))
True
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.6.post1.dev0+g1234"))
False
>>> is_released_octoprint_version(version=pkg_resources.parse_version("1.3.7.dev123+g23545"))
False
"""
if version is None:
version = get_octoprint_version()
if isinstance(version, tuple):
# old setuptools
return "*@" not in version
else:
# new setuptools
return "dev" not in version.public
def is_stable_octoprint_version(version=None):
"""
>>> import pkg_resources
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.6rc3"))
False
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.6rc3.dev2+g1234"))
False
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.6"))
True
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.6.post1+g1234"))
True
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.6.post1.dev0+g1234"))
False
>>> is_stable_octoprint_version(version=pkg_resources.parse_version("1.3.7.dev123+g23545"))
False
"""
if version is None:
version = get_octoprint_version()
if not is_released_octoprint_version(version=version):
return False
if isinstance(version, tuple):
return "*a" not in version and "*b" not in version and "*c" not in version
else:
return not version.is_prerelease
def is_octoprint_compatible(*compatibility_entries, **kwargs):
"""
Tests if the current ``octoprint_version`` is compatible to any of the provided ``compatibility_entries``.
+237
View File
@@ -0,0 +1,237 @@
import unittest
import mock
import ddt
import octoprint.util.comm
@ddt.ddt
class TestCommErrorHandling(unittest.TestCase):
def setUp(self):
self._comm = mock.create_autospec(octoprint.util.comm.MachineCom)
# mocks
self._comm._handle_errors = lambda *args, **kwargs: octoprint.util.comm.MachineCom._handle_errors(self._comm, *args, **kwargs)
self._comm._recoverable_communication_errors = octoprint.util.comm.MachineCom._recoverable_communication_errors
self._comm._resend_request_communication_errors = octoprint.util.comm.MachineCom._resend_request_communication_errors
self._comm._sd_card_errors = octoprint.util.comm.MachineCom._sd_card_errors
self._comm._lastCommError = None
self._comm._errorValue = None
self._comm._clear_to_send = mock.Mock()
# settings
self._comm._ignore_errors = False
self._comm._disconnect_on_errors = True
self._comm.isPrinting.return_value = True
self._comm.isError.return_value = False
@ddt.data(
# Marlin
"Error: Line Number is not Last Line Number+1, Last Line: 1",
# Repetier
"Error: Expected Line 1 got 2",
# !! error type for good measure
"!! expected line 1 got 2"
)
def test_lineno_mismatch(self, line):
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_resend()
@ddt.data(
# Marlin
"Error: No Line Number with checksum, Last Line: 1",
)
def test_lineno_missing(self, line):
"""Should simulate OK to force resend request"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_recoverable()
@ddt.data(
# Marlin
"Error: checksum mismatch",
# Repetier
"Error: Wrong checksum",
)
def test_checksum_mismatch(self, line):
"""Should prepare receiving resend request"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_resend()
@ddt.data(
# Marlin
"Error: No Checksum with line number, Last Line: 1",
# Repetier
"Error: Missing checksum",
)
def test_checksum_missing(self, line):
"""Should prepare receiving resend request"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_resend()
@ddt.data(
# Marlin
"Error: volume.init failed",
"Error: openRoot failed",
"Error: workDir open failed",
"Error: Cannot enter subdir: folder",
# Repetier
"Error: file.open failed",
# Marlin & Repetier (halleluja!)
"Error: error writing to file",
"Error: open failed, File: foo.gco",
# Legacy?
"Error: Cannot open foo.gco",
)
def test_sd_error(self, line):
"""Should pass"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_nop()
@ddt.data(
# Marlin
"Error: Unknown command: \"ABC\"",
# Repetier
"Error: Unknown command:ABC",
)
def test_unknown_command(self, line):
"""Should pass"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
self.assert_nop()
@ddt.data("Error: Printer on fire")
def test_other_error_disconnect(self, line):
"""Should trigger escalation"""
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
# what should have happened
self.assert_disconnected()
# what should not have happened
self.assert_not_handle_ok()
self.assert_not_last_comm_error()
self.assert_not_print_cancelled()
self.assert_not_cleared_to_send()
@ddt.data("Error: Printer on fire")
def test_other_error_cancel(self, line):
"""Should trigger print cancel"""
self._comm._disconnect_on_errors = False
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
# what should have happened
self.assert_print_cancelled()
self.assert_cleared_to_send()
# what should not have happened
self.assert_not_handle_ok()
self.assert_not_last_comm_error()
self.assert_not_disconnected()
@ddt.data("Error: Printer on fire")
def test_other_error_ignored(self, line):
"""Should only log"""
self._comm._ignore_errors = True
result = self._comm._handle_errors(line)
self.assertEqual(line, result)
# what should have happened
self.assert_cleared_to_send()
# what should not have happened
self.assert_not_handle_ok()
self.assert_not_last_comm_error()
self.assert_not_print_cancelled()
def test_not_an_error(self):
"""Should pass"""
result = self._comm._handle_errors("Not an error")
self.assertEqual("Not an error", result)
self.assert_nop()
def test_already_error(self):
"""Should pass"""
self._comm.isError.return_value = True
result = self._comm._handle_errors("Error: Printer on fire")
self.assertEqual("Error: Printer on fire", result)
self.assert_nop()
def test_line_none(self):
"""Should pass"""
self.assertIsNone(self._comm._handle_errors(None))
##~~ assertion helpers
def assert_handle_ok(self):
self._comm._handle_ok.assert_called_once()
def assert_not_handle_ok(self):
self._comm._handle_ok.assert_not_called()
def assert_last_comm_error(self):
self.assertIsNotNone(self._comm._lastCommError)
def assert_not_last_comm_error(self):
self.assertIsNone(self._comm._lastCommError)
def assert_disconnected(self):
self.assertIsNotNone(self._comm._errorValue)
self._comm._changeState.assert_called_once()
def assert_not_disconnected(self):
self.assertIsNone(self._comm._errorValue)
self._comm._changeState.assert_not_called()
def assert_print_cancelled(self):
self._comm.cancelPrint.assert_called_once()
def assert_not_print_cancelled(self):
self._comm.cancelPrint.assert_not_called()
def assert_cleared_to_send(self):
self._comm._clear_to_send.set.assert_called_once()
def assert_not_cleared_to_send(self):
self._comm._clear_to_send.set.assert_not_called()
def assert_nop(self):
self.assert_not_handle_ok()
self.assert_not_last_comm_error()
self.assert_not_disconnected()
self.assert_not_print_cancelled()
self.assert_not_cleared_to_send()
def assert_recoverable(self):
self.assert_handle_ok()
self.assert_not_last_comm_error()
self.assert_not_disconnected()
self.assert_not_print_cancelled()
self.assert_not_cleared_to_send()
def assert_resend(self):
self.assert_last_comm_error()
self.assert_not_handle_ok()
self.assert_not_disconnected()
self.assert_not_print_cancelled()
self.assert_not_cleared_to_send()
Binary file not shown.
File diff suppressed because it is too large. Load diff
+17 -6
View File
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OctoPrint 1.3.6.dev192+ge9d17f0f.dirty\n"
"Project-Id-Version: OctoPrint 1.3.6rc2.dev10+g41eb9481\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2017-11-30 18:14+0100\n"
"POT-Creation-Date: 2017-12-05 12:29+0100\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"
@@ -349,6 +349,17 @@ msgid ""
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:9
#: src/octoprint/templates/snippets/settings/server/serverPluginBlacklistDescription.jinja2:7
#, python-format
msgid ""
"\n"
" By default, OctoPrint will use the blacklist hosted at "
"<code>plugins.octoprint.org/blacklist.json</code> which you\n"
" can also take a look at in a more human readable format <a "
"href=\"%(url)s\" target=\"_blank\">here</a>.\n"
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:14
msgid ""
"\n"
" Please decide whether to allow fetch and use of this centralized "
@@ -357,15 +368,15 @@ msgid ""
"Server right from within OctoPrint.\n"
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:15
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:20
msgid "Disable Plugin Blacklist Processing"
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:16
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:21
msgid "Enable Plugin Blacklist Processing"
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:20
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:25
msgid ""
"\n"
" Plugin blacklist processing is <strong class=\"text-"
@@ -373,7 +384,7 @@ msgid ""
" "
msgstr ""
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:23
#: src/octoprint/plugins/corewizard/templates/corewizard_pluginblacklist_wizard.jinja2:28
msgid ""
"\n"
" Plugin blacklist processing is <strong class=\"text-"