Merge branch 'staging/maintenance' into maintenance

This commit is contained in:
Gina Häußge 2017-07-27 14:38:54 +02:00
commit e508898564
17 changed files with 129 additions and 36 deletions

View file

@ -22,8 +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.5rc2
staging/maintenance 1.3.5rc2 1a6dbb3f4a5bef857cdeb13c031b9deca2cf30a2 pep440-dev
# staging/maintenance is currently the branch for preparation of 1.3.5rc3
# so is regressionfix/...
staging/maintenance 1.3.5rc3 1f9fe8c8689f727566ae92707fe1e3f40064dcdf pep440-dev
regressionfix/.* 1.3.5rc3 1f9fe8c8689f727566ae92707fe1e3f40064dcdf 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

View file

@ -1,5 +1,19 @@
# OctoPrint Changelog
## 1.3.5rc2 (2017-07-27)
### Bug fixes
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) - Temperature tab: Fix for legend in graph not updating with current values on mouse over.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) - Temperature tab: Fix for new temperature inputs not fitting on one line in Firefox.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) - Temperature tab & GCODE viewer: Fix for available tools (and offsets) not properly updating on change of printer profile.
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) - Wizard: Fix sorting of required wizards not properly handling non-ASCII unicode.
* [#2035](https://github.com/foosel/OctoPrint/issues/2035) - Fix an issue of the server not starting up if there's a file in the analysis backlog. The reason for this is that spawning a new process while the intermediary server is active causes the server port to be blocked (this is due to how subprocessing works by default), in turn leading to an error on startup since the port cannot be bound by the actual server. Since the GCODE analysis takes now place in its own subprocess and hence triggers this problem, it had to be moved until after the actual server has already started up to avoid this problem.
* Wizard: Fix `onWizardPreventSettingsRefreshDialog` callback invocation.
* Corewizard plugin: Fix `firstrunonly` wizards (e.g. for printer profile configuration) being displayed again if _any_ of the sub wizards (e.g. for the online check opt-in and configuration) is active.
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.5rc1...1.3.5rc2))
## 1.3.5rc1 (2017-07-26)
### Improvements

View file

@ -180,9 +180,12 @@ class FileManager(object):
import octoprint.settings
self._recovery_file = os.path.join(octoprint.settings.settings().getBaseFolder("data"), "print_recovery_data.yaml")
def initialize(self):
def initialize(self, process_backlog=False):
self.reload_plugins()
if process_backlog:
self.process_backlog()
def process_backlog(self):
def worker():
self._logger.info("Adding backlog items from all storage types to analysis queue...".format(**locals()))
for storage_type, storage_manager in self._storage_managers.items():

View file

@ -25,6 +25,13 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
names = self._get_subwizard_attrs("_get_", "_wizard_name")
additional = self._get_subwizard_attrs("_get_", "_additional_wizard_template_data")
firstrunonly = self._get_subwizard_attrs("_is_", "_wizard_firstrunonly")
firstrun = self._settings.global_get(["server", "firstRun"])
if not firstrun:
required = dict((key, value) for key, value in required.items()
if not firstrunonly.get(key, lambda: False)())
result = list()
for key, method in required.items():
if not method():
@ -63,10 +70,12 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
firstrunonly = self._get_subwizard_attrs("_is_", "_wizard_firstrunonly")
firstrun = self._settings.global_get(["server", "firstRun"])
any_not_firstrunonly = any(map(lambda m: not m(), firstrunonly.values()))
if not firstrun:
required = dict((key, value) for key, value in required.items()
if not firstrunonly.get(key, lambda: False)())
any_required = any(map(lambda m: m(), required.values()))
return (firstrun or any_not_firstrunonly) and any_required
return any_required
def get_wizard_details(self):
result = dict()

View file

@ -27,6 +27,11 @@ import atexit
import signal
import base64
try:
import fcntl
except ImportError:
fcntl = None
SUCCESS = {}
NO_CONTENT = ("", 204)
NOT_MODIFIED = ("Not Modified", 304)
@ -214,6 +219,17 @@ class Server(object):
# start the intermediary server
self._start_intermediary_server()
### IMPORTANT!
###
### Do not start any subprocesses until the intermediary server shuts down again or they WILL inherit the
### open port and prevent us from firing up Tornado later. Thanks to close_fds not being available on Popen
### on Windows if you also want to be able to redirect stdout/stderr/stdin and fnctl also not being available
### we don't have a good way around this issue besides being careful not to spawn processes here.
###
### Which kinda sucks tbh.
###
### See also issue #2035
# then initialize the plugin manager
pluginManager.reload_plugins(startup=True, initialize_implementations=False)
@ -569,8 +585,13 @@ class Server(object):
self._server = util.tornado.CustomHTTPServer(self._tornado_app, max_body_sizes=max_body_sizes, default_max_body_size=self._settings.getInt(["server", "maxSize"]))
self._server.listen(self._port, address=self._host)
### From now on it's ok to launch subprocesses again
eventManager.fire(events.Events.STARTUP)
# analysis backlog
fileManager.process_backlog()
# auto connect
if self._settings.getBoolean(["serial", "autoconnect"]):
try:
@ -1356,21 +1377,37 @@ class Server(object):
rules = map(process, filter(lambda rule: len(rule) == 2 or len(rule) == 3, rules))
self._intermediary_server = BaseHTTPServer.HTTPServer((host, port), lambda *args, **kwargs: IntermediaryServerHandler(rules, *args, **kwargs))
self._intermediary_server = BaseHTTPServer.HTTPServer((host, port),
lambda *args, **kwargs: IntermediaryServerHandler(rules, *args, **kwargs),
bind_and_activate=False)
# if possible, make sure our socket's port descriptor isn't handed over to subprocesses
if fcntl is not None and hasattr(fcntl, "FD_CLOEXEC"):
flags = fcntl.fcntl(self._intermediary_server.socket, fcntl.F_GETFD)
flags |= fcntl.FD_CLOEXEC
fcntl.fcntl(self._intermediary_server.socket, fcntl.F_SETFD, flags)
# then bind the server and have it serve our handler until stopped
try:
self._intermediary_server.server_bind()
self._intermediary_server.server_activate()
except:
self._intermediary_server.server_close()
raise
thread = threading.Thread(target=self._intermediary_server.serve_forever)
thread.daemon = True
thread.start()
self._logger.debug("Intermediary server started")
self._logger.info("Intermediary server started")
def _stop_intermediary_server(self):
if self._intermediary_server is None:
return
self._logger.debug("Shutting down intermediary server...")
self._logger.info("Shutting down intermediary server...")
self._intermediary_server.shutdown()
self._intermediary_server.server_close()
self._logger.debug("Intermediary server shut down")
self._logger.info("Intermediary server shut down")
class LifecycleManager(object):
def __init__(self, plugin_manager):

View file

@ -21,6 +21,7 @@ from octoprint.server import app, userManager, pluginManager, gettext, \
NOT_MODIFIED
from octoprint.settings import settings
from octoprint.filemanager import get_all_extensions
from octoprint.util import to_unicode
import re
import base64
@ -466,7 +467,7 @@ def _process_templates():
tab=dict(add="append", key="name"),
settings=dict(add="custom_append", key="name", custom_add_entries=lambda missing: dict(section_plugins=(gettext("Plugins"), None)), custom_add_order=lambda missing: ["section_plugins"] + missing),
usersettings=dict(add="append", key="name"),
wizard=dict(add="append", key="name", key_extractor=lambda d, k: "0:{}".format(d[0]) if "mandatory" in d[1] and d[1]["mandatory"] else "1:{}".format(d[0])),
wizard=dict(add="append", key="name", key_extractor=lambda d, k: u"0:{}".format(to_unicode(d[0])) if "mandatory" in d[1] and d[1]["mandatory"] else u"1:{}".format(to_unicode(d[0]))),
about=dict(add="append", key="name"),
generic=dict(add="append", key=None)
)

File diff suppressed because one or more lines are too long

View file

@ -1000,10 +1000,13 @@ function setOnViewModelsIf(allViewModels, key, value, condition) {
}
function callViewModels(allViewModels, method, callback) {
if (!allViewModels) return;
callViewModelsIf(allViewModels, method, undefined, callback);
}
function callViewModelsIf(allViewModels, method, condition, callback) {
if (!allViewModels) return;
if (condition == undefined || !_.isFunction(condition)) {
condition = function() { return true; };
}

View file

@ -109,8 +109,7 @@ $(function() {
self.reader_sortLayers.subscribe(self.synchronizeOptions);
self.reader_hideEmptyLayers.subscribe(self.synchronizeOptions);
// subscribe to relevant printer settings...
self.settings.printerProfiles.currentProfileData.subscribe(function() {
self._printerProfileUpdated = function() {
if (!self.enabled) return;
var currentProfileData = self.settings.printerProfiles.currentProfileData();
@ -146,6 +145,27 @@ $(function() {
}
});
}
};
// subscribe to relevant printer settings...
self.settings.printerProfiles.currentProfileData.subscribe(function() {
self._printerProfileUpdated();
if (self.settings.printerProfiles.currentProfileData()) {
if (self.settings.printerProfiles.currentProfileData().extruder) {
self.settings.printerProfiles.currentProfileData().extruder.count.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles.currentProfileData().extruder.sharedNozzle.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles.currentProfileData().extruder.offsets.subscribe(self._printerProfileUpdated);
}
if (self.settings.printerProfiles.currentProfileData().volume) {
self.settings.printerProfiles.currentProfileData().volume.width.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles.currentProfileData().volume.depth.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles.currentProfileData().volume.formFactor.subscribe(self._printerProfileUpdated);
}
if (self.settings.printerProfiles.currentProfileData().axes) {
self.settings.printerProfiles.currentProfileData().axes.x.inverted.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles.currentProfileData().axes.y.inverted.subscribe(self._printerProfileUpdated);
}
}
});
self.settings.feature_g90InfluencesExtruder.subscribe(function() {
@ -194,11 +214,13 @@ $(function() {
currentProfileData = self.settings.printerProfiles.currentProfileData();
}
if (currentProfileData && currentProfileData.extruder && currentProfileData.extruder.offsets() && !currentProfileData.extruder.sharedNozzle()) {
if (currentProfileData && currentProfileData.extruder) {
var offsets = [];
_.each(currentProfileData.extruder.offsets(), function(offset) {
offsets.push({x: offset[0], y: offset[1]})
});
if (currentProfileData.extruder.offsets() && !currentProfileData.extruder.sharedNozzle()) {
_.each(currentProfileData.extruder.offsets(), function(offset) {
offsets.push({x: offset[0], y: offset[1]})
});
}
return offsets;
} else {
return undefined;

View file

@ -95,7 +95,7 @@ $(function() {
self._printerProfileUpdated = function() {
var graphColors = ["red", "orange", "green", "brown", "purple"];
var heaterOptions = {};
var tools = self.tools();
var tools = [];
var color;
// tools
@ -123,7 +123,7 @@ $(function() {
if (tools.length < 1 || !tools[0]) {
tools[0] = self._createToolEntry();
}
tools[0]["name"](gettext("Hotend"));
tools[0]["name"](gettext("Tool"));
tools[0]["key"]("tool0");
}
@ -147,6 +147,7 @@ $(function() {
self.settingsViewModel.printerProfiles.currentProfileData.subscribe(function() {
self._printerProfileUpdated();
self.settingsViewModel.printerProfiles.currentProfileData().extruder.count.subscribe(self._printerProfileUpdated);
self.settingsViewModel.printerProfiles.currentProfileData().extruder.sharedNozzle.subscribe(self._printerProfileUpdated);
self.settingsViewModel.printerProfiles.currentProfileData().heatedBed.subscribe(self._printerProfileUpdated);
});
@ -721,9 +722,7 @@ $(function() {
}
});
}
};
self.onStartup = function() {
self.changeOffsetDialog = $("#change_offset_dialog");
};

View file

@ -193,7 +193,7 @@ $(function() {
if (!self.finishing && self.isDialogActive()
&& hasDataChanged(self.settingsViewModel.getLocalData(), self.settingsViewModel.lastReceivedSettings)) {
var preventSettingsRefreshDialog = false;
callViewModels(allViewModels, "onWizardPreventSettingsRefreshDialog", function(method) {
callViewModels(self.allViewModels, "onWizardPreventSettingsRefreshDialog", function(method) {
// if any of our methods returns that it wants to prevent the dialog
// we'll need to set preventSettingsRefreshDialog to true
//

View file

@ -435,8 +435,11 @@ table {
}
&.temperature_tool {
width: 18%;
width: 16%;
text-align: left;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
&.temperature_actual {
@ -444,7 +447,7 @@ table {
}
&.temperature_target {
width: 40%;
width: 42%;
overflow: visible;
}

View file

@ -19,8 +19,8 @@
</table>
<script type="text/html" id="temprow-template">
<th class="temperature_tool" data-bind="text: name"></th>
<td class="temperature_actual" data-bind="html: formatTemperature(actual())"></td>
<th class="temperature_tool" data-bind="text: name, attr: {title: name}"></th>
<td class="temperature_actual" data-bind="html: formatTemperature(actual()), attr: {title: formatTemperature(actual())}"></td>
<td class="temperature_target">
<form class="form-inline" style="margin:0" data-bind="submit: function(element) { $root.setTarget($data, element) }">
<div class="input-prepend input-append">

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2017-07-26 12:30+0200\n"
"PO-Revision-Date: 2017-07-26 12:40+0100\n"
"PO-Revision-Date: 2017-07-27 12:07+0100\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"
@ -1875,7 +1875,7 @@ msgstr "Trennen"
#: src/octoprint/static/js/app/viewmodels/printerstate.js:234
#: src/octoprint/static/js/app/viewmodels/temperature.js:115
msgid "Tool"
msgstr "Werkzeug"
msgstr "Tool"
#: src/octoprint/static/js/app/viewmodels/control.js:78
#: src/octoprint/static/js/app/viewmodels/temperature.js:126
@ -3061,11 +3061,11 @@ msgstr "Vor dem Fortsetzen eines Druckjobs"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:33
msgid "Before tool change"
msgstr "Vor Werkzeugwechsel"
msgstr "Vor Toolwechsel"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:39
msgid "After tool change"
msgstr "Nach Werkzeugwechsel"
msgstr "Nach Toolwechsel"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:45
msgid "After connection to printer is established"
@ -4034,7 +4034,7 @@ msgstr "Feedrate:"
#: src/octoprint/templates/tabs/control.jinja2:93
msgid "Select Tool..."
msgstr "Werkzeug wählen..."
msgstr "Tool wählen..."
#: src/octoprint/templates/tabs/control.jinja2:104
msgid "Extrude"

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: OctoPrint\n"
"Report-Msgid-Bugs-To: i18n@octoprint.org\n"
"POT-Creation-Date: 2017-07-26 12:30+0200\n"
"PO-Revision-Date: 2017-07-26 12:40+0100\n"
"PO-Revision-Date: 2017-07-27 12:07+0100\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"
@ -1875,7 +1875,7 @@ msgstr "Trennen"
#: src/octoprint/static/js/app/viewmodels/printerstate.js:234
#: src/octoprint/static/js/app/viewmodels/temperature.js:115
msgid "Tool"
msgstr "Werkzeug"
msgstr "Tool"
#: src/octoprint/static/js/app/viewmodels/control.js:78
#: src/octoprint/static/js/app/viewmodels/temperature.js:126
@ -3061,11 +3061,11 @@ msgstr "Vor dem Fortsetzen eines Druckjobs"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:33
msgid "Before tool change"
msgstr "Vor Werkzeugwechsel"
msgstr "Vor Toolwechsel"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:39
msgid "After tool change"
msgstr "Nach Werkzeugwechsel"
msgstr "Nach Toolwechsel"
#: src/octoprint/templates/dialogs/settings/gcodescripts.jinja2:45
msgid "After connection to printer is established"
@ -4034,7 +4034,7 @@ msgstr "Feedrate:"
#: src/octoprint/templates/tabs/control.jinja2:93
msgid "Select Tool..."
msgstr "Werkzeug wählen..."
msgstr "Tool wählen..."
#: src/octoprint/templates/tabs/control.jinja2:104
msgid "Extrude"