Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20e2773

Browse files
committed
chore(pluginmanager)!: remove deprecated endpoint
1 parent 5b51a7b commit 20e2773

2 files changed

Lines changed: 1 addition & 78 deletions

File tree

src/octoprint/plugins/pluginmanager/__init__.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
with_revalidation_checking,
3535
)
3636
from octoprint.settings import valid_boolean_trues
37-
from octoprint.util import RepeatedTimer, deprecated, to_bytes
37+
from octoprint.util import RepeatedTimer, to_bytes
3838
from octoprint.util.net import download_file
3939
from octoprint.util.pip import (
4040
OUTPUT_SUCCESS,
@@ -875,39 +875,6 @@ def on_api_command(self, command, data):
875875
plugin = self._plugin_manager.plugins[plugin_name]
876876
return self.command_toggle(plugin, command)
877877

878-
@deprecated(
879-
"Deprecated API endpoint api/plugin/pluginmanager used. "
880-
"Please switch clients to plugin/pluginmanager/*",
881-
since="1.6.0",
882-
)
883-
def on_api_get(self, r):
884-
if not Permissions.PLUGIN_PLUGINMANAGER_MANAGE.can():
885-
abort(403)
886-
887-
refresh_repository = (
888-
request.values.get("refresh_repository", "false") in valid_boolean_trues
889-
)
890-
if refresh_repository or not self._is_repository_cache_valid():
891-
self._repository_available = self._refresh_repository()
892-
893-
refresh_notices = (
894-
request.values.get("refresh_notices", "false") in valid_boolean_trues
895-
)
896-
if refresh_notices or not self._is_notices_cache_valid():
897-
self._notices_available = self._refresh_notices()
898-
899-
refresh_orphan = (
900-
request.values.get("refresh_orphans", "false") in valid_boolean_trues
901-
)
902-
if refresh_orphan:
903-
self._get_orphans(refresh=True)
904-
905-
result = {}
906-
result.update(**self._plugin_response())
907-
result.update(**self._orphan_response())
908-
result.update(**self._repository_response())
909-
return jsonify(**result)
910-
911878
def is_api_protected(self):
912879
return True
913880

src/octoprint/plugins/pluginmanager/static/clientjs/pluginmanager.js

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,6 @@
99
this.base = base;
1010
};
1111

12-
OctoPrintPluginManagerClient.prototype.get = function (refresh, opts) {
13-
console.log(
14-
"Deprecated endpoint OctoPrint.plugin.pluginmanager.get, " +
15-
"please use OctoPrint.plugin.pluginmanager.get*"
16-
);
17-
var refresh_repo, refresh_notices, refresh_orphans;
18-
if (_.isPlainObject(refresh)) {
19-
refresh_repo = refresh.repo || false;
20-
refresh_notices = refresh.notices || false;
21-
refresh_orphans = refresh.orphans || false;
22-
} else {
23-
refresh_repo = refresh;
24-
refresh_notices = false;
25-
refresh_orphans = false;
26-
}
27-
28-
var query = [];
29-
if (refresh_repo) query.push("refresh_repository=true");
30-
if (refresh_notices) query.push("refresh_notices=true");
31-
if (refresh_orphans) query.push("refresh_orphans=true");
32-
33-
return this.base.get(
34-
this.base.getSimpleApiUrl("pluginmanager") +
35-
(query.length ? "?" + query.join("&") : ""),
36-
opts
37-
);
38-
};
39-
40-
OctoPrintPluginManagerClient.prototype.getWithRefresh = function (opts) {
41-
console.log(
42-
"Deprecated endpoint OctoPrint.plugin.pluginmanager.getWithRefresh, " +
43-
"please use OctoPrint.plugin.pluginmanager.get*"
44-
);
45-
return this.get(true, opts);
46-
};
47-
48-
OctoPrintPluginManagerClient.prototype.getWithoutRefresh = function (opts) {
49-
console.log(
50-
"Deprecated endpoint OctoPrint.plugin.pluginmanager.getWithoutRefresh, " +
51-
"please use OctoPrint.plugin.pluginmanager.get*"
52-
);
53-
return this.get(false, opts);
54-
};
55-
5612
OctoPrintPluginManagerClient.prototype.getPlugins = function (refresh, opts) {
5713
var url = this.base.getBlueprintUrl("pluginmanager") + "plugins";
5814
return this.base.get(url + (refresh ? "?refresh=true" : ""), opts);

0 commit comments

Comments
 (0)