Merge branch 'maintenance' into devel

This commit is contained in:
GitHub Nightly Merge Action committed 2022-03-04 00:11:23 +00:00
commit 30739dd375
9 files changed
+4134 -2774

No files matched your search

@@ -119,7 +119,7 @@ class PluginManagerPlugin(
octoprint.plugin.EventHandlerPlugin,
):
ARCHIVE_EXTENSIONS = (".zip", ".tar.gz", ".tgz", ".tar", ".gz")
ARCHIVE_EXTENSIONS = (".zip", ".tar.gz", ".tgz", ".tar", ".gz", ".whl")
PYTHON_EXTENSIONS = (".py",)
# valid pip install URL schemes according to https://pip.pypa.io/en/stable/reference/pip_install/
@@ -463,6 +463,10 @@ class PluginManagerPlugin(
},
"safe_mode": safe_mode,
"online": self._connectivity_checker.online,
"supported_extensions": {
"archive": self.ARCHIVE_EXTENSIONS,
"python": self.PYTHON_EXTENSIONS,
},
}
@octoprint.plugin.BlueprintPlugin.route("/plugins")
@@ -489,6 +493,8 @@ class PluginManagerPlugin(
hash_update(repr(self._notices))
hash_update(repr(safe_mode))
hash_update(repr(self._connectivity_checker.online))
hash_update(repr(self.ARCHIVE_EXTENSIONS))
hash_update(repr(self.PYTHON_EXTENSIONS))
hash_update(repr(_DATA_FORMAT_VERSION))
return hash.hexdigest()
@@ -210,6 +210,40 @@ $(function () {
self.safeMode = ko.observable();
self.online = ko.observable();
self.supportedArchiveExtensions = ko.observableArray([]);
self.supportedPythonExtensions = ko.observableArray([]);
var createExtensionsHelp = function (extensions) {
return _.reduce(
extensions,
function (result, ext, index) {
return (
result +
'"' +
ext +
'"' +
(index < extensions.length - 2
? ", "
: index == extensions.length - 2
? " " + gettext("and") + " "
: "")
);
},
""
);
};
self.supportedExtensionsHelp = ko.pureComputed(function () {
var archiveExts = createExtensionsHelp(self.supportedArchiveExtensions());
var pythonExts = createExtensionsHelp(self.supportedPythonExtensions());
return _.sprintf(
"This does not look like a valid plugin. Valid plugins should be " +
"either archives installable via <code>pip</code> that " +
"have the extension %(archiveExtensions)s, or single file python " +
"plugins with the extension %(pythonExtensions)s.",
{archiveExtensions: archiveExts, pythonExtensions: pythonExts}
);
});
self.requestError = ko.observable(false);
@@ -395,7 +429,9 @@ $(function () {
});
self.invalidFile = ko.pureComputed(function () {
var allowedFileExtensions = [".zip", ".tar.gz", ".tgz", ".tar", ".py"];
var allowedFileExtensions = self
.supportedArchiveExtensions()
.concat(self.supportedPythonExtensions());
var name = self.uploadFilename();
var lowerName = name !== undefined ? name.toLocaleLowerCase() : undefined;
@@ -594,6 +630,12 @@ $(function () {
}
};
self.fromSupportedExtensionsResponse = function (data) {
if (!data) return;
self.supportedArchiveExtensions(data.archive || []);
self.supportedPythonExtensions(data.python || []);
};
self.dataPluginsDeferred = undefined;
self.requestPluginData = function (options) {
if (!_.isPlainObject(options)) {
@@ -632,6 +674,7 @@ $(function () {
self.requestError(false);
self.fromPluginsResponse(data.plugins, options);
self.fromPipResponse(data.pip);
self.fromSupportedExtensionsResponse(data.supported_extensions);
self.safeMode(data.safe_mode || false);
deferred.resolveWith(data);
});
@@ -339,7 +339,7 @@
</div>
<button id="settings_plugin_pluginmanager_repositorydialog_upload_start" class="btn btn-primary span3" data-bind="enable: enableFileInstall, css: {disabled: !enableFileInstall()}, click: function(){}">{{ _('Install') }}</button>
</div>
<span class="help-block" data-bind="visible: invalidFile">{{ _('This does not look like a valid plugin. Valid plugins should be either zip files or tarballs installable via <code>pip</code> that have the extension ".zip", ".tar.gz", ".tgz" or ".tar", or single file python plugins with the extension ".py"') }}</span>
<span class="help-block" data-bind="visible: invalidFile, html: supportedExtensionsHelp"></span>
</form>
<div>
@@ -1321,32 +1321,31 @@ $(function () {
: progress_percent > 75
? "progress-success"
: "progress-warning";
var countdownText = _.sprintf(
gettext("Updating in %(sec)i secs..."),
{
sec: messageData.timeout_value
}
);
queuedUpdatesPopupOptions.title = gettext(
"Starting Queued Updates"
);
queuedUpdatesPopupOptions.text =
'<div class="row-fluid"><ul><li>' +
'<div class="row-fluid"><p></p><ul><li>' +
_.map(self.availableAndQueued(), function (info) {
return info.displayName;
}).join("</li><li>") +
'</li></ul></div><div class="progress progress-softwareupdate ' +
'</li></ul></p></div><div class="progress progress-softwareupdate ' +
progress_class +
'"><div class="bar">' +
gettext("Updating in ") +
" " +
messageData.timeout_value +
" " +
gettext("secs") +
countdownText +
'</div><div class="progress-text" style="clip-path: inset(0 0 0 ' +
progress_percent +
"%);-webkit-clip-path: inset(0 0 0 " +
progress_percent +
'%);">' +
gettext("Updating in ") +
" " +
messageData.timeout_value +
" " +
gettext("secs") +
countdownText +
"</div></div>";
queuedUpdatesPopupOptions.confirm = {
confirm: true,
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
+1222 -883
View File
File diff suppressed because it is too large. Load diff