Merge branch 'staging/maintenance' into maintenance

This commit is contained in:
Gina Häußge committed 2017-05-24 14:51:24 +02:00
commit 7c6b85a0ad
11 files changed
+2885 -1169

No files matched your search

+10 -2
View File
@@ -1378,6 +1378,14 @@ class SettingsPlugin(OctoPrintPlugin):
Of course, you are always free to completely override both :func:`on_settings_load` and :func:`on_settings_save` if the
default implementations do not fit your requirements.
.. warning::
Make sure to protect sensitive information stored by your plugin that only logged in administrators (or users)
should have access to via :meth:`~octoprint.plugin.SettingsPlugin.get_settings_restricted_paths`. OctoPrint will
return its settings on the REST API even to anonymous clients, but will filter out fields it know are restricted,
therefore you **must** make sure that you specify sensitive information accordingly to limit access as required!
.. attribute:: _settings
The :class:`~octoprint.plugin.PluginSettings` instance to use for accessing the plugin's settings. Injected by
@@ -1549,8 +1557,8 @@ class SettingsPlugin(OctoPrintPlugin):
field="field"),
path=dict(to=dict(never=dict(return="return"))))
def get_settings_restricted_path(self):
return dict(admin=[["some", "admin_only", "path"], ["another", "admin_only", "path"],
def get_settings_restricted_paths(self):
return dict(admin=[["some", "admin_only", "path"], ["another", "admin_only", "path"],],
user=[["some", "user_only", "path"],],
never=[["path", "to", "never", "return"],])
@@ -10,7 +10,7 @@ $(function() {
self.defaultPostRoll = 0;
self.defaultInterval = 10;
self.defaultRetractionZHop = 0;
self.defaultCapturePostroll = true;
self.defaultCapturePostRoll = true;
self.timelapseType = ko.observable(undefined);
self.timelapseTimedInterval = ko.observable(self.defaultInterval);
@@ -159,18 +159,20 @@ $(function() {
// timelapse config
self.timelapseType(config.type);
if (config.type == "timed") {
if (config.interval != undefined && config.interval > 0) {
self.timelapseTimedInterval(config.interval);
}
if (config.type == "timed" && config.interval != undefined && config.interval > 0) {
self.timelapseTimedInterval(config.interval);
} else {
self.timelapseTimedInterval(self.defaultInterval);
}
if (config.type == "zchange") {
if (config.retractionZHop != undefined && config.retractionZHop > 0) {
self.timelapseRetractionZHop(config.retractionZHop);
}
if (config.type == "timed" && config.capturePostRoll != undefined){
self.timelapseCapturePostRoll(config.capturePostRoll);
} else {
self.timelapseCapturePostRoll(self.defaultCapturePostRoll);
}
if (config.type == "zchange" && config.retractionZHop != undefined && config.retractionZHop > 0) {
self.timelapseRetractionZHop(config.retractionZHop);
} else {
self.timelapseRetractionZHop(self.defaultRetractionZHop);
}
@@ -187,12 +189,6 @@ $(function() {
self.timelapseFps(self.defaultFps);
}
if (config.capturePostRoll != undefined){
self.timelapseCapturePostRoll(config.capturePostRoll);
} else {
self.timelapseCapturePostRoll(self.defaultCapturePostRoll);
}
self.persist(false);
self.isDirty(false);
};
+4 -5
View File
@@ -307,7 +307,7 @@ def configure_timelapse(config=None, persist=False):
if "options" in config and "interval" in config["options"] and config["options"]["interval"] > 0:
interval = config["options"]["interval"]
capture_post_roll = False
capture_post_roll = True
if "options" in config and "capturePostRoll" in config["options"] and isinstance(config["options"]["capturePostRoll"], bool):
capture_post_roll = config["options"]["capturePostRoll"]
@@ -703,10 +703,6 @@ class TimedTimelapse(Timelapse):
self._copying_postroll()
self.post_roll_finished()
def post_roll_finished(self):
Timelapse.post_roll_finished(self)
self._timer = None
def _timer_active(self):
return self._in_timelapse or self._postroll_captures > 0
@@ -719,6 +715,9 @@ class TimedTimelapse(Timelapse):
if self._capture_post_roll:
self.post_roll_finished()
# timer is done, delete it
self._timer = None
class TimelapseRenderJob(object):
File diff suppressed because it is too large. Load diff