Merge branch 'staging/maintenance' into maintenance

This commit is contained in:
Gina Häußge committed 2019-04-04 17:12:01 +02:00
commit 30ddbfd324
24 files changed
+4588 -1555

No files matched your search

+3 -3
View File
@@ -24,10 +24,10 @@ maintenance 1.3.12 73df8c2407f04756261acfe62ac3d72877f8a97d pep440-dev
fix/.* 1.3.12 73df8c2407f04756261acfe62ac3d72877f8a97d pep440-dev
improve/.* 1.3.12 73df8c2407f04756261acfe62ac3d72877f8a97d pep440-dev
# staging/maintenance is currently the branch for preparation of 1.3.11rc2
# staging/maintenance is currently the branch for preparation of 1.3.11rc3
# so is regressionfix/...
staging/maintenance 1.3.11rc2 73df8c2407f04756261acfe62ac3d72877f8a97d pep440-dev
regressionfix/.* 1.3.11rc2 73df8c2407f04756261acfe62ac3d72877f8a97d pep440-dev
staging/maintenance 1.3.11rc3 18e7d2b72ad73c5d8e522cebbc001d0e8a3dff14 pep440-dev
regressionfix/.* 1.3.11rc3 18e7d2b72ad73c5d8e522cebbc001d0e8a3dff14 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
+38
View File
@@ -1,5 +1,43 @@
# OctoPrint Changelog
## 1.3.11rc2 (2019-04-04)
### Improvements
* More resilience against broken configurations.
* More resilience against platform startup issues during environment detection.
* Don't confuse users with pip's new "OMG PY2.7 IS EOL!!1!" message.
* Error Tracking: Severely restrict what gets tracked:
* we are only interested in handled core exceptions or unhandled exceptions
* we are not interested at all in `SerialException`
* in the frontend we are only interested in things originating in the `static` files
* in the frontend we are not interested in anything originating in `packed_plugins.js`
### Bug fixes
* [#3088](https://github.com/foosel/OctoPrint/issues/3088) (regression) - Fix 500 error on index rendering in case of plugins that use unicode in plugin vars.
* [#3089](https://github.com/foosel/OctoPrint/issues/3089) (regression) - Fix missing `_chamberTemp` definition
* [#3090](https://github.com/foosel/OctoPrint/issues/3090) (regression) - Fix missing method causing an exception on `/api/printer/tool` endpoint
* [#3091](https://github.com/foosel/OctoPrint/issues/3091) (regression) - Printer Safety Check: Fix unicode errors in certain communication scenarios.
* [#3092](https://github.com/foosel/OctoPrint/issues/3092) - Fix invalid tool parameter detection on `/api/printer/tool` endpoint.
* [#3098](https://github.com/foosel/OctoPrint/issues/3098) - Backup: Exclude temporary timelapse files as well if timelapses are excluded from backup.
* Fix missing default value for `self._errorValue` in comm layer.
* Don't read return code on async system commands, it won't work.
### Unreproduced issues
The following issues were reported in RC1 but so far have been unreproduced and further data to analyse them is still missing. If you encounter any of them please report back with a [fully filled out issue template](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#what-should-i-include-in-a-bug-report):
* ["Print completes but temp data appears to be 'stuck' at last known value for bed and hotend."](https://github.com/foosel/OctoPrint/issues/3087#issuecomment-478369220)
### Special thanks to all the contributors!
Special thanks to everyone who contributed to this release candidate and provided full, analysable bug reports.
### More information
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.11rc1...1.3.11rc1)
## 1.3.11rc1 (2019-03-28)
### Heads-up: 1.3.11 unbundles the Cura plugin
+5 -2
View File
@@ -142,5 +142,8 @@ be edited from OctoPrint's settings dialog.
## Special Thanks
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
Cross-browser testing services are kindly provided by [BrowserStack](https://www.browserstack.com/).
Profiling is done with the help of [PyVmMonitor](https://www.pyvmmonitor.com).
Error tracking is powered and sponsored by [Sentry](https://sentry.io).
+1 -2
View File
@@ -23,7 +23,6 @@ thanks to everyone who contributed!
* Ernesto Martinez
* Frank Sander
* George Robles
* Jared Go
* jean-claude migneault
* Jeff Renfer
* Jefferson Hunt
@@ -55,4 +54,4 @@ thanks to everyone who contributed!
* Trent Shumay
* Ulrich Kempken
and 1513 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
and 1509 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
+7 -2
View File
@@ -25,10 +25,15 @@ class EnvironmentDetector(object):
self._cache = None
self._cache_lock = threading.RLock()
self._environment_plugins = self._plugin_manager.get_implementations(EnvironmentDetectionPlugin)
self._logger = logging.getLogger(__name__)
try:
self._environment_plugins = self._plugin_manager.get_implementations(EnvironmentDetectionPlugin)
except Exception:
# just in case, see #3100...
self._logger.exception("There was an error fetching EnvironmentDetectionPlugins from the plugin manager")
self._environment_plugins = []
@property
def environment(self):
with self._cache_lock:
+3
View File
@@ -620,6 +620,9 @@ class BackupPlugin(octoprint.plugin.SettingsPlugin,
if exclude is None:
exclude = []
if "timelapse" in exclude:
exclude.append("timelapse_tmp")
configfile = settings._configfile
basedir = settings._basedir
@@ -12,8 +12,10 @@ 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://827d1f11ccda4b31b924f29aaacab493@sentry.io/1373987"
SENTRY_URL_COREUI = "https://30bdc39d2248444c8bc01484f38c9444@sentry.io/1374096"
from serial import SerialException
SENTRY_URL_SERVER = "https://4273b441bb654c4398de42ba86350963@sentry.io/1373987"
SENTRY_URL_COREUI = "https://f9bcd7185f73430bbe7c09ff69586b0f@sentry.io/1374096"
SETTINGS_DEFAULTS = dict(enabled=False,
enabled_unreleased=False,
@@ -21,6 +23,10 @@ SETTINGS_DEFAULTS = dict(enabled=False,
url_server=SENTRY_URL_SERVER,
url_coreui=SENTRY_URL_COREUI)
IGNORED_EXCEPTIONS = [
(SerialException, "octoprint.util.comm"),
]
class ErrorTrackingPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
@@ -94,13 +100,55 @@ def _enable_errortracking():
if _is_enabled(enabled, enabled_unreleased):
import sentry_sdk
from octoprint.plugin import plugin_manager
def _before_send(event, hint):
if not "exc_info" in hint:
# we only want exceptions
return None
handled = True
logger = event.get("logger", "")
for ignore in IGNORED_EXCEPTIONS:
if isinstance(ignore, tuple):
ignored_exc, ignored_logger = ignore
if isinstance(hint["exc_info"][1], ignored_exc) and logger.startswith(ignored_logger):
# exception ignored for logger
return None
elif isinstance(ignore, type):
if isinstance(hint["exc_info"][1], ignore):
# exception ignored
return None
if event.get("exception") and event["exception"].get("values"):
handled = not any(map(lambda x: x.get("mechanism") and x["mechanism"].get("handled", True) == False,
event["exception"]["values"]))
if handled:
# error is handled, restrict further based on logger
if logger != "" and not (logger.startswith("octoprint.") or logger.startswith("tornado.")):
# we only want errors logged by loggers octoprint.* or tornado.*
return None
if logger.startswith("octoprint.plugins."):
plugin_id = logger.split(".")[2]
plugin_info = plugin_manager().get_plugin_info(plugin_id)
if plugin_info is None or not plugin_info.bundled:
# we only want our active bundled plugins
return None
return event
sentry_sdk.init(url_server,
release=version)
release=version,
before_send=_before_send)
with sentry_sdk.configure_scope() as scope:
scope.user = dict(id=unique_id)
logging.getLogger("octoprint.plugin.errortracking").info("Initialized error tracking")
logging.getLogger("octoprint.plugins.errortracking").info("Initialized error tracking")
_enabled = True
@@ -1,3 +1,2 @@
/*! @sentry/browser 4.5.1 (6a390acf) | https://github.com/getsentry/sentry-javascript */
var Sentry=function(t){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r,o,i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e,n,r){return new(n||(n=Promise))(function(o,i){function s(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(s,a)}u((r=r.apply(t,e||[])).next())})}function a(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function u(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}function p(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return t instanceof Error}}function f(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function h(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function d(t){return void 0===t}function v(t){return"function"==typeof t}function g(t){return"[object String]"===Object.prototype.toString.call(t)}function y(t){return"[object Object]"===Object.prototype.toString.call(t)}function m(t){return t!=t}function b(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}}function E(){var t=b(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function x(t){var e,n,r,o,i,s=[];if(!t||!t.tagName)return"";if(s.push(t.tagName.toLowerCase()),t.id&&s.push("#"+t.id),(e=t.className)&&g(e))for(n=e.split(/\s+/),i=0;i<n.length;i++)s.push("."+n[i]);var a=["type","name","title","alt"];for(i=0;i<a.length;i++)r=a[i],(o=t.getAttribute(r))&&s.push("["+r+'="'+o+'"]');return s.join("")}function _(t){if(!t)return{};var e=t.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function S(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function w(t){var e=b();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log"].forEach(function(t){t in e.console&&n[t].__sentry__&&(r[t]=n[t].__sentry_wrapped__,n[t]=n[t].__sentry_original__)});var o=t();return Object.keys(r).forEach(function(t){n[t]=r[t]}),o}function k(t,e){return void 0===e&&(e=0),0!==e&&g(t)?t.length<=e?t:t.substr(0,e)+"...":t}function O(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var o=t[r];try{n.push(String(o))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function j(t,e){return!(Line truncated
//# sourceMappingURL=bundle.min.js.map
/*! @sentry/browser 5.0.5 (913eafc4) | https://github.com/getsentry/sentry-javascript */
var Sentry=function(n){"use strict";var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,r)};function r(n,r){function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i,e,o,u=function(){return(u=Object.assign||function(n){for(var t,r=1,i=arguments.length;r<i;r++)for(var e in t=arguments[r])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}).apply(this,arguments)};function c(n,t,r,i){return new(r||(r=Promise))(function(e,o){function u(n){try{s(i.next(n))}catch(n){o(n)}}function c(n){try{s(i.throw(n))}catch(n){o(n)}}function s(n){n.done?e(n.value):new r(function(t){t(n.value)}).then(u,c)}s((i=i.apply(n,t||[])).next())})}function s(n,t){var r,i,e,o,u={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(e=2&o[0]?i.return:o[0]?i.throw||((e=i.return)&&e.call(i),0):i.next)&&!(e=e.call(i,o[1])).done)return e;switch(i=0,e&&(o=[2&o[0],e.value]),o[0]){case 0:case 1:e=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,i=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(e=(e=u.trys).length>0&&e[e.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!e||o[1]>e[0]&&o[1]<e[3])){u.label=o[1];break}if(6===o[0]&&u.label<e[1]){u.label=e[1],e=o;break}if(e&&u.label<e[2]){u.label=e[2],u.ops.push(o);break}e[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(n,u)}catch(n){o=[6,n],i=0}finally{r=e=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}function f(n,t){var r="function"==typeof Symbol&&n[Symbol.iterator];if(!r)return n;var i,e,o=r.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)u.push(i.value)}catch(n){e={error:n}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return u}function a(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(f(arguments[t]));return n}function h(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return n instanceof Error}}function v(n){return"[object ErrorEvent]"===Object.prototype.toString.call(n)}function l(n){return"[object DOMError]"===Object.prototype.toString.call(n)}function d(n){return"[object String]"===Object.prototype.toString.call(n)}function p(n){return null===n||"object"!=typeof n&&"function"!=typeof n}function m(n){return"[object Object]"===Object.prototype.toString.call(n)}function y(n){return Boolean(n&&n.then&&"function"==typeof n.then)}!function(n){n[n.None=0]="None",n[n.Error=1]="Error",n[n.Debug=2]="Debug",n[n.Verbose=3]="Verbose"}(i||(i={})),(e=n.Severity||(n.Severity={})).Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical",function(n){n.fromString=function(t){switch(t){case"debug":return n.Debug;case"info":return n.Info;case"warn":case"warning":return n.Warning;case"error":return n.Error;case"fatal":return n.Fatal;case"critical":return n.Critical;case"log":default:return n.Log}}}(n.Severity||(n.Severity={})),(o=n.Status||(n.Status={})).Unknown="unknown",o.Skipped="skipped",o.Success="success",o.RateLimit="rate_limit",o.Invalid="invalid",o.Failed="failed",function(n){n.fromHttpCode=function(t){return t>=200&&t<300?n.Success:429===t?n.RateLimit:t>=400&&t<500?n.Invalid:t>=500?n.Failed:n.Unknown}}(n.Status||(n.Status={}));var b={};function w(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:b}function g(){var n=w(),t=n.crypto||n.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var i=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return i(r[0])+i(r[1])+i(r[2])+i(r[3])+i(r[4])+i(r[5])+i(r[6])+i(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}function E(n){var t,r,i,e,o,u=[];if(!n||!n.tagName)return"";if(u.push(n.tagName.toLowerCase()),n.id&&u.push("#"+n.id),(t=n.className)&&d(t))for(r=t.split(/\s+/),o=0;o<r.length;o++)u.push("."+r[o]);var c=["type","name","title","alt"];for(o=0;o<c.length;o++)i=c[o],(e=n.getAttribute(i))&&u.push("["+i+'="'+e+'"]');return u.join("")}function x(n){if(!n)return{};var t=n.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",i=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+i}}function j(n){if(n.message)return n.message;if(n.exception&&n.exception.values&&n.excepLine truncated
@@ -7,7 +7,15 @@
Sentry.init({
dsn: errortracking_url_coreui,
release: VERSION
release: VERSION,
whitelistUrls: [
// only include static assets
"/static/"
],
blacklistUrls: [
// exclude third party plugins
"/static/webassets/packed_plugins.js"
]
});
Sentry.configureScope(function (scope) {
scope.setUser({"id": errortracking_unique_id});
@@ -688,7 +688,9 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
if additional_args:
args.append(additional_args)
return self._pip_caller.execute(*args)
kwargs = dict(env=dict(PYTHONWARNINGS="ignore:DEPRECATION::pip._internal.cli.base_command"))
return self._pip_caller.execute(*args, **kwargs)
def _log_message(self, *lines):
self._log(lines, prefix=u"*", stream="message")
@@ -87,7 +87,7 @@ def perform_update(target, check, target_version, log_cb=None, online=True, forc
logger.debug(u"Target: %s, executing pip install %s" % (target, install_arg))
pip_args = ["--disable-pip-version-check", "install", install_arg, "--no-cache-dir"]
pip_kwargs = dict()
pip_kwargs = dict(env=dict(PYTHONWARNINGS="ignore:DEPRECATION::pip._internal.cli.base_command"))
if pip_working_directory is not None:
pip_kwargs.update(cwd=pip_working_directory)
+2 -1
View File
@@ -29,4 +29,5 @@ def execute(command, cwd=None, evaluate_returncode=True, **kwargs):
if evaluate_returncode and p.returncode != 0:
raise ScriptError(p.returncode, p.stdout.text, p.stderr.text)
return p.returncode, p.stdout.text, p.stderr.text
if not do_async:
return p.returncode, p.stdout.text, p.stderr.text
@@ -18,7 +18,7 @@ from serial import SerialTimeoutException
from octoprint.settings import settings
from octoprint.plugin import plugin_manager
from octoprint.util import RepeatedTimer, monotonic_time
from octoprint.util import RepeatedTimer, monotonic_time, to_bytes
class VirtualPrinter(object):
command_regex = re.compile("^([GMTF])(\d+)")
@@ -45,7 +45,7 @@ class VirtualPrinter(object):
self._seriallog.addHandler(seriallog_handler)
self._seriallog.setLevel(logging.INFO)
self._seriallog.info("-"*78)
self._seriallog.info(u"-"*78)
self._read_timeout = read_timeout
self._write_timeout = write_timeout
@@ -1379,13 +1379,13 @@ class VirtualPrinter(object):
return 0
if "M112" in data and self._supportM112:
self._seriallog.info("<<< {}".format(data.strip()))
self._seriallog.info(u"<<< {}".format(data.strip()))
self._kill()
return len(data)
try:
written = self.incoming.put(data, timeout=self._write_timeout, partial=True)
self._seriallog.info("<<< {}".format(data.strip()))
self._seriallog.info(u"<<< {}".format(data.strip()))
return written
except queue.Full:
self._logger.info("Incoming queue is full, raising SerialTimeoutException")
@@ -1421,9 +1421,9 @@ class VirtualPrinter(object):
try:
# fetch a line from the queue, wait no longer than timeout
line = self.outgoing.get(timeout=timeout)
self._seriallog.info(">>> {}".format(line.strip()))
self._seriallog.info(u">>> {}".format(line.strip()))
self.outgoing.task_done()
return line
return to_bytes(line, errors="replace")
except queue.Empty:
# queue empty? return empty line
return ""
+2
View File
@@ -54,8 +54,10 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
# TODO do we really need to hold the temperature here?
self._temp = None
self._bedTemp = None
self._chamberTemp = None
self._targetTemp = None
self._targetBedTemp = None
self._targetChamberTemp = None
self._temps = TemperatureHistory(cutoff=settings().getInt(["temperature", "cutoff"])*60)
self._tempBacklog = []
+14 -2
View File
@@ -18,6 +18,8 @@ from collections import defaultdict
from flask import request, jsonify, make_response
import logging
from octoprint.settings import settings
from octoprint.server import admin_permission
@@ -78,9 +80,19 @@ def getInstalledLanguagePacks():
plugin_packs[plugin_entry.name]["display"] = plugin_info.name
for language_entry in scandir(plugin_entry.path):
plugin_packs[plugin_entry.name]["languages"].append(load_meta(language_entry.path, language_entry.name))
try:
plugin_packs[plugin_entry.name]["languages"].append(load_meta(language_entry.path, language_entry.name))
except Exception:
logging.getLogger(__name__).exception("Error while parsing metadata for language pack {} from {} for plugin {}".format(language_entry.name,
language_entry.path,
plugin_entry.name))
continue
else:
core_packs.append(load_meta(entry.path, entry.name))
try:
core_packs.append(load_meta(entry.path, entry.name))
except Exception:
logging.getLogger(__name__).exception("Error while parsing metadata for core language pack {} from {}".format(entry.name,
entry.path))
result = dict(_core=dict(identifier="_core", display="Core", languages=core_packs))
result.update(plugin_packs)
+17 -6
View File
@@ -33,12 +33,18 @@ def printerState():
result = {}
processor = lambda x: x
if not printerProfileManager.get_current_or_default()["heatedBed"]:
processor = _delete_bed
# add temperature information
if not "temperature" in excludes:
processor = lambda x: x
heated_bed = printerProfileManager.get_current_or_default()["heatedBed"]
heated_chamber = printerProfileManager.get_current_or_default()["heatedChamber"]
if not heated_bed and not heated_chamber:
processor = _keep_tools
elif not heated_bed:
processor = _delete_bed
elif not heated_chamber:
processor = _delete_chamber
result.update({"temperature": _get_temperature_data(processor)})
# add sd information
@@ -80,7 +86,7 @@ def printerToolCommand():
##~~ tool selection
if command == "select":
tool = data["tool"]
if re.match(validation_regex, tool) is None:
if not isinstance(tool, basestring) or re.match(validation_regex, tool) is None:
return make_response("Invalid tool: %s" % tool, 400)
if not tool.startswith("tool"):
return make_response("Invalid tool for selection: %s" % tool, 400)
@@ -151,7 +157,7 @@ def printerToolState():
if not printer.is_operational():
return make_response("Printer is not operational", 409)
return jsonify(_get_temperature_data(_delete_bed))
return jsonify(_get_temperature_data(_keep_tools))
##~~ Heated bed
@@ -483,10 +489,15 @@ def _keep_tools(x):
def _keep_bed(x):
return _delete_from_data(x, lambda k: k != "bed")
def _delete_bed(x):
return _delete_from_data(x, lambda k: k == "bed")
def _keep_chamber(x):
return _delete_from_data(x, lambda k: k != "chamber")
def _delete_chamber(x):
return _delete_from_data(x, lambda k: k == "chamber")
def _delete_from_data(x, key_matcher):
data = dict(x)
+1 -1
View File
@@ -280,7 +280,7 @@ class PrinterStateConnection(octoprint.vendor.sockjs.tornado.SockJSConnection, o
self.send({type: payload})
except Exception as e:
if self._logger.isEnabledFor(logging.DEBUG):
self._logger.exception("Could not send message to client {}".format(self._remoteAddress))
self._logger.warn("Could not send message to client {}".format(self._remoteAddress), exc_info=True)
else:
self._logger.warn("Could not send message to client {}: {}".format(self._remoteAddress, e))
+4 -2
View File
@@ -21,7 +21,7 @@ from octoprint.server import app, userManager, pluginManager, gettext, \
NOT_MODIFIED
from octoprint.settings import settings
from octoprint.filemanager import full_extension_tree, get_all_extensions
from octoprint.util import to_unicode
from octoprint.util import to_unicode, to_bytes
import re
import base64
@@ -196,7 +196,9 @@ def index():
default_additional_etag = [enable_accesscontrol,
enable_gcodeviewer,
enable_timelapse] + sorted(["{}:{}".format(k, v) for k, v in _plugin_vars.items()])
enable_timelapse] + sorted(["{}:{}".format(to_bytes(k, errors="replace"),
to_bytes(v, errors="replace"))
for k, v in _plugin_vars.items()])
def get_preemptively_cached_view(key, view, data=None, additional_request_data=None, additional_unless=None):
if (data is None and additional_request_data is None) or g.locale is None:
File diff suppressed because it is too large. Load diff
+19 -17
View File
@@ -174,8 +174,9 @@ def serialList():
+ glob.glob("/dev/rfcomm*")
additionalPorts = settings().get(["serial", "additionalPorts"])
for additional in additionalPorts:
baselist += glob.glob(additional)
if additionalPorts:
for additional in additionalPorts:
baselist += glob.glob(additional)
prev = settings().get(["serial", "port"])
if prev in baselist:
@@ -467,6 +468,8 @@ class MachineCom(object):
self._lastResendNumber = None
self._currentResendCount = 0
self._errorValue = ""
self._firmware_detection = settings().getBoolean(["serial", "firmwareDetection"])
self._firmware_info_received = not self._firmware_detection
self._firmware_info = dict()
@@ -633,6 +636,8 @@ class MachineCom(object):
self._log(message)
def _log(self, message):
message = to_unicode(message)
self._terminal_log.append(message)
self._callback.on_comm_log(message)
self._serialLogger.debug(message)
@@ -2548,12 +2553,9 @@ class MachineCom(object):
self._log("Trying {}".format(p))
programmer.connect(p)
serial_obj = programmer.leaveISP()
except ispBase.IspError as e:
self._log("Could not enter programming mode on {}, might not be a printer or just not allow programming mode".format(p))
self._logger.info("Could not enter programming mode on {}: {}".format(p, e))
except:
self._log("Could not connect to {}: {}".format(p, get_exception_string()))
self._logger.exception("Could not connect to {}".format(p))
self._log("Could not connect to or enter programming mode on {}, might not be a printer or just not allow programming mode".format(p))
self._logger.info("Could not enter programming mode on {}: {}".format(p, e))
found = serial_obj is not None
programmer.close()
@@ -2737,17 +2739,17 @@ class MachineCom(object):
self.close(is_error=True)
return None
if ret != "":
try:
self._log("Recv: " + sanitize_ascii(ret))
except ValueError as e:
self._log("WARN: While reading last line: %s" % e)
self._log("Recv: " + repr(ret))
try:
ret = ret.decode('utf-8')
except UnicodeDecodeError:
ret = ret.decode('latin1')
self._log(u"Recv: {}".format(ret))
for name, hook in self._received_message_hooks.items():
try:
ret = hook(self, ret)
except:
except Exception:
self._logger.exception("Error while processing hook {name}:".format(**locals()))
else:
if ret is None:
@@ -3338,7 +3340,7 @@ class MachineCom(object):
return
if log:
self._log("Send: " + str(cmd))
self._log(u"Send: {}".format(to_unicode(cmd, errors="replace")))
cmd += "\n"
written = 0
@@ -3369,7 +3371,7 @@ class MachineCom(object):
self._log("Unexpected error while writing to serial port: %s" % (get_exception_string()))
if isinstance(ex, serial.SerialException):
self._dual_log("Please see https://faq.octoprint.org/serialerror for possible reasons of this.",
level=logging.ERROR)
level=logging.INFO)
self._errorValue = get_exception_string()
self.close(is_error=True)
break
@@ -3379,7 +3381,7 @@ class MachineCom(object):
self._log("Unexpected error while writing to serial port: %s" % (get_exception_string()))
if isinstance(ex, serial.SerialException):
self._dual_log("Please see https://faq.octoprint.org/serialerror for possible reasons of this.",
level=logging.ERROR)
level=logging.INFO)
self._errorValue = get_exception_string()
self.close(is_error=True)
break
Binary file not shown.
File diff suppressed because it is too large. Load diff
+33 -33
View File
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OctoPrint 1.3.11.dev281+g40396847e.dirty\n"
"Project-Id-Version: OctoPrint 1.3.11rc2.dev18+g0b6dd7e76\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2019-03-26 10:49+0100\n"
"POT-Creation-Date: 2019-04-04 14:21+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"
@@ -350,7 +350,7 @@ msgstr ""
msgid "Backup & Restore"
msgstr ""
#: src/octoprint/plugins/backup/__init__.py:947
#: src/octoprint/plugins/backup/__init__.py:950
msgid ""
"Without this plugin you will no longer be able to backup & restore your "
"OctoPrint settings and data."
@@ -595,13 +595,13 @@ msgid "Server Commands"
msgstr ""
#: src/octoprint/plugins/corewizard/subwizards.py:49
#: src/octoprint/server/views.py:583
#: src/octoprint/server/views.py:585
msgid "Webcam & Timelapse"
msgstr ""
#: src/octoprint/plugins/corewizard/subwizards.py:64
#: src/octoprint/plugins/corewizard/templates/corewizard_acl_wizard.jinja2:1
#: src/octoprint/server/views.py:589
#: src/octoprint/server/views.py:591
msgid "Access Control"
msgstr ""
@@ -1002,7 +1002,7 @@ msgid ""
"discoverable on the network via Bonjour and uPnP."
msgstr ""
#: src/octoprint/plugins/errortracking/__init__.py:33
#: src/octoprint/plugins/errortracking/__init__.py:39
#: src/octoprint/plugins/errortracking/templates/errortracking_settings.jinja2:1
msgid "Error Tracking"
msgstr ""
@@ -1288,7 +1288,7 @@ msgid ""
"shouldn't have to change this."
msgstr ""
#: src/octoprint/plugins/pluginmanager/__init__.py:181
#: src/octoprint/plugins/pluginmanager/__init__.py:182
msgid "Plugin Manager"
msgstr ""
@@ -1859,7 +1859,7 @@ msgid "Software Update"
msgstr ""
#: src/octoprint/plugins/softwareupdate/__init__.py:1048
#: src/octoprint/server/views.py:587
#: src/octoprint/server/views.py:589
#: src/octoprint/static/js/app/viewmodels/appearance.js:99
#: src/octoprint/static/js/app/viewmodels/appearance.js:104
#: src/octoprint/static/js/app/viewmodels/appearance.js:106
@@ -2410,109 +2410,109 @@ msgid ""
"tracking.octoprint.org</a>.\n"
msgstr ""
#: src/octoprint/server/views.py:497
#: src/octoprint/server/views.py:499
msgid "Plugins"
msgstr ""
#: src/octoprint/server/views.py:554
#: src/octoprint/server/views.py:556
#: src/octoprint/templates/dialogs/settings/serialconnection.jinja2:12
msgid "Connection"
msgstr ""
#: src/octoprint/server/views.py:555
#: src/octoprint/server/views.py:557
#: src/octoprint/templates/sidebar/state.jinja2:1
msgid "State"
msgstr ""
#: src/octoprint/server/views.py:556
#: src/octoprint/server/views.py:558
msgid "Files"
msgstr ""
#: src/octoprint/server/views.py:562
#: src/octoprint/server/views.py:564
msgid "Temperature"
msgstr ""
#: src/octoprint/server/views.py:563
#: src/octoprint/server/views.py:565
msgid "Control"
msgstr ""
#: src/octoprint/server/views.py:564
#: src/octoprint/server/views.py:566
msgid "GCode Viewer"
msgstr ""
#: src/octoprint/server/views.py:565
#: src/octoprint/server/views.py:567
msgid "Terminal"
msgstr ""
#: src/octoprint/server/views.py:566
#: src/octoprint/server/views.py:568
#: src/octoprint/templates/sidebar/state.jinja2:8
msgid "Timelapse"
msgstr ""
#: src/octoprint/server/views.py:572
#: src/octoprint/server/views.py:574
msgid "Printer"
msgstr ""
#: src/octoprint/server/views.py:574
#: src/octoprint/server/views.py:576
msgid "Serial Connection"
msgstr ""
#: src/octoprint/server/views.py:575
#: src/octoprint/server/views.py:577
#: src/octoprint/templates/dialogs/settings/printerprofiles.jinja2:1
msgid "Printer Profiles"
msgstr ""
#: src/octoprint/server/views.py:576
#: src/octoprint/server/views.py:578
msgid "Temperatures"
msgstr ""
#: src/octoprint/server/views.py:577
#: src/octoprint/server/views.py:579
msgid "Terminal Filters"
msgstr ""
#: src/octoprint/server/views.py:578
#: src/octoprint/server/views.py:580
msgid "GCODE Scripts"
msgstr ""
#: src/octoprint/server/views.py:580 src/octoprint/server/views.py:582
#: src/octoprint/server/views.py:582 src/octoprint/server/views.py:584
msgid "Features"
msgstr ""
#: src/octoprint/server/views.py:584
#: src/octoprint/server/views.py:586
msgid "GCODE Visualizer"
msgstr ""
#: src/octoprint/server/views.py:585
#: src/octoprint/server/views.py:587
msgid "API"
msgstr ""
#: src/octoprint/server/views.py:590
#: src/octoprint/server/views.py:592
#: src/octoprint/templates/dialogs/settings/folders.jinja2:2
#: src/octoprint/templates/sidebar/files_header.jinja2:10
msgid "Folders"
msgstr ""
#: src/octoprint/server/views.py:591
#: src/octoprint/server/views.py:593
msgid "Appearance"
msgstr ""
#: src/octoprint/server/views.py:592
#: src/octoprint/server/views.py:594
msgid "Server"
msgstr ""
#: src/octoprint/server/views.py:598
#: src/octoprint/server/views.py:600
msgid "Access"
msgstr ""
#: src/octoprint/server/views.py:599
#: src/octoprint/server/views.py:601
msgid "Interface"
msgstr ""
#: src/octoprint/server/views.py:615
#: src/octoprint/server/views.py:617
msgid "Start"
msgstr ""
#: src/octoprint/server/views.py:616
#: src/octoprint/server/views.py:618
#: src/octoprint/templates/dialogs/wizard.jinja2:57
msgid "Finish"
msgstr ""