1 parent
b124de4f04
commit
1f97ee333d
2 files changed
+27
-16
No files matched your search
@@ -1755,6 +1755,21 @@ class PluginManagerPlugin(
|
||||
|
||||
return result
|
||||
|
||||
def generate_plugins_json(self, ignore_bundled=True, ignore_plugins_folder=True):
|
||||
plugins = []
|
||||
plugin_folder = self._settings.getBaseFolder("plugins")
|
||||
for plugin in self._plugin_manager.plugins.values():
|
||||
if (ignore_bundled and plugin.bundled) or (
|
||||
ignore_plugins_folder
|
||||
and isinstance(plugin.origin, octoprint.plugin.core.FolderOrigin)
|
||||
and plugin.origin.folder == plugin_folder
|
||||
):
|
||||
# ignore bundled or from the plugins folder already included in the backup
|
||||
continue
|
||||
|
||||
plugins.append({"key": plugin.key, "name": plugin.name, "url": plugin.url})
|
||||
return plugins
|
||||
|
||||
def _to_external_plugin(self, plugin):
|
||||
return {
|
||||
"key": plugin.key,
|
||||
@@ -1898,3 +1913,8 @@ def __plugin_load__():
|
||||
"octoprint.events.register_custom_events": _register_custom_events,
|
||||
"octoprint.access.permissions": __plugin_implementation__.get_additional_permissions,
|
||||
}
|
||||
|
||||
global __plugin_helpers__
|
||||
__plugin_helpers__ = {
|
||||
"generate_plugins_json": __plugin_implementation__.generate_plugins_json,
|
||||
}
|
||||
Reference in new issue
Block a user