Merge branch 'maintenance' into devel

This commit is contained in:
Gina Häußge committed 2017-06-02 16:36:08 +02:00
commit 3171958a8c
7 files changed
+57 -20

No files matched your search

+10 -7
View File
@@ -49,9 +49,12 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
#~~ AssetPlugin API
def get_assets(self):
return dict(
js=["js/corewizard.js"]
)
if self.is_wizard_required():
return dict(
js=["js/corewizard.js"]
)
else:
return dict()
#~~ WizardPlugin API
@@ -74,7 +77,7 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
return self._user_manager.enabled and not self._user_manager.hasBeenCustomized()
def _get_acl_wizard_details(self):
return dict()
return dict(required=self._is_acl_wizard_required())
def _get_acl_wizard_name(self):
return gettext("Access Control")
@@ -119,7 +122,7 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
return not (webcam_snapshot_url and webcam_stream_url and ffmpeg_path)
def _get_webcam_wizard_details(self):
return dict()
return dict(required=self._is_webcam_wizard_required())
def _get_webcam_wizard_name(self):
return gettext("Webcam & Timelapse")
@@ -134,7 +137,7 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
return not (system_shutdown_command and system_restart_command and server_restart_command)
def _get_servercommands_wizard_details(self):
return dict()
return dict(required=self._is_servercommands_wizard_required())
def _get_servercommands_wizard_name(self):
return gettext("Server Commands")
@@ -145,7 +148,7 @@ class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
return self._printer_profile_manager.is_default_unmodified() and self._printer_profile_manager.profile_count == 1
def _get_printerprofile_wizard_details(self):
return dict()
return dict(required=self._is_printerprofile_wizard_required())
def _get_printerprofile_wizard_name(self):
return gettext("Default Printer Profile")
@@ -11,6 +11,8 @@ $(function() {
self.setup = ko.observable(false);
self.decision = ko.observable();
self.required = false;
self.passwordMismatch = ko.pureComputed(function() {
return self.password() != self.confirmedPassword();
});
@@ -72,6 +74,8 @@ $(function() {
};
self.onBeforeWizardTabChange = function(next, current) {
if (!self.required) return true;
if (!current || !_.startsWith(current, "wizard_plugin_corewizard_acl_") || self.setup()) {
return true;
}
@@ -82,7 +86,13 @@ $(function() {
return false;
};
self.onWizardDetails = function(response) {
self.required = response && response.corewizard && response.corewizard.details && response.corewizard.details.acl && response.corewizard.details.acl.required;
};
self.onWizardFinish = function() {
if (!self.required) return;
if (!self.decision()) {
return "reload";
}
@@ -94,7 +104,14 @@ $(function() {
self.settingsViewModel = parameters[0];
self.required = false;
self.onWizardDetails = function(response) {
self.required = response && response.corewizard && response.corewizard.details && response.corewizard.details.webcam && response.corewizard.details.webcam.required;
};
self.onWizardFinish = function() {
if (!self.required) return;
if (self.settingsViewModel.webcam_streamUrl()
|| (self.settingsViewModel.webcam_snapshotUrl() && self.settingsViewModel.webcam_ffmpegPath())) {
return "reload";
@@ -113,18 +130,29 @@ $(function() {
self.printerProfiles = parameters[0];
self.required = false;
self.editor = self.printerProfiles.createProfileEditor();
self.editorLoaded = ko.observable(false);
self.onStartup = function() {
self.onWizardDetails = function(response) {
self.required = response && response.corewizard && response.corewizard.details && response.corewizard.details.printerprofile && response.corewizard.details.printerprofile.required;
if (!self.required) return;
OctoPrint.printerprofiles.get("_default")
.done(function(data) {
self.editor.fromProfileData(data);
self.editorLoaded(true);
})
.fail(function() {
self.editor.fromProfileData();
self.editorLoaded(true);
});
};
self.onWizardFinish = function() {
if (!self.required) return;
OctoPrint.printerprofiles.update("_default", self.editor.toProfileData())
.done(function() {
self.printerProfiles.requestData();
@@ -919,8 +919,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
result["force_base"] = False
if check.get("update_script", None):
# if we are using the update_script, we need to set our update_branch and force
# to install the exact version we requested
# if we are using the update_script, we need to set our update_branch
if check.get("prerelease", None):
# we are tracking prereleases => we want to be on the correct prerelease channel/branch
@@ -930,14 +929,13 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
# in case it's not already set
result["update_branch"] = check.get("update_branch", channel)
# we also force our target version in the update
result["force_exact_version"] = True
else:
# we are not tracking prereleases, but aren't on the stable branch either => switch back
# to stable branch on update
result["update_branch"] = check.get("update_branch", stable_branch)
# we also force an exact version
result["force_exact_version"] = True
if BRANCH != result.get("prerelease_channel"):
# we force python unequality check here because that will also allow us to
+2 -2
View File
@@ -228,7 +228,7 @@ class PrinterProfileManager(object):
self._logger.info("Migrated default printer profile from settings to _default.profile: {!r}".format(default_overrides))
def _verify_default_available(self):
default_id = settings().get(["printerProfile", "default"])
default_id = settings().get(["printerProfiles", "default"])
if default_id is None:
default_id = "_default"
@@ -342,7 +342,7 @@ class PrinterProfileManager(object):
if identifier is not None and not identifier in all_identifiers:
return
settings().set(["printerProfile", "default"], identifier)
settings().set(["printerProfiles", "default"], identifier)
settings().save()
def get_current_or_default(self):
+2 -3
View File
@@ -1174,8 +1174,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
except:
self._logger.exception("Error while trying to persist print recovery data")
def _payload_for_print_job_event(self, location=None, print_job_file=None, position=None):
print_job_size = None
def _payload_for_print_job_event(self, location=None, print_job_file=None, print_job_size=None, position=None):
if print_job_file is None:
with self._selectedFileMutex:
selected_file = self._selectedFile
@@ -1186,7 +1185,7 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
print_job_size = selected_file.get("filesize", None)
location = FileDestinations.SDCARD if selected_file.get("sd", False) else FileDestinations.LOCAL
if not print_job_file or not print_job_size or not location:
if not print_job_file or not location:
return dict()
if location == FileDestinations.SDCARD:
@@ -476,8 +476,16 @@ $(function() {
});
self.profiles.updateItems(items);
self.defaultProfile(defaultProfile);
self.currentProfile(currentProfile);
self.currentProfileData(currentProfileData);
if (currentProfile && currentProfileData) {
self.currentProfile(currentProfile);
self.currentProfileData(currentProfileData);
} else {
// shouldn't normally happen, but just to not have anything else crash...
log.warn("Current printer profile could not be detected, using default values");
self.currentProfile("");
self.currentProfileData(ko.mapping.fromJS(cleanProfile(), self.currentProfileData));
}
};
self.addProfile = function(callback) {
+1
View File
@@ -1295,6 +1295,7 @@ class MachineCom(object):
self._logger.info("Detected Malyan firmware, enabling relevant features for issue free communication")
self._alwaysSendChecksum = True
self._blockWhileDwelling = True
sd_always_available = self._sdAlwaysAvailable
self._sdAlwaysAvailable = True