mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Handle plugin not found due to mixed plugin metadata
CURA-5202 Plugin metadata that comes from the plugin server is also saved into PluginRegistry's metadata collection, so it's all mixed. Plugins that are just installed cannot be loaded immediately, and this causes an error in checkCanUpgrade().
This commit is contained in:
parent
cadb2c62b7
commit
95c6258d0f
1 changed files with 8 additions and 2 deletions
|
@ -6,6 +6,7 @@ from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkRepl
|
|||
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
from UM.PluginError import PluginNotFoundError
|
||||
from UM.PluginRegistry import PluginRegistry
|
||||
from UM.Qt.Bindings.PluginsModel import PluginsModel
|
||||
from UM.Extension import Extension
|
||||
|
@ -302,10 +303,15 @@ class PluginBrowser(QObject, Extension):
|
|||
return self._plugins_model
|
||||
|
||||
def _checkCanUpgrade(self, plugin_id, version):
|
||||
if plugin_id not in self._plugin_registry.getInstalledPlugins():
|
||||
if not self._plugin_registry.isInstalledPlugin(plugin_id):
|
||||
return False
|
||||
|
||||
try:
|
||||
plugin_object = self._plugin_registry.getPluginObject(plugin_id)
|
||||
except PluginNotFoundError:
|
||||
Logger.log("w", "Could not find plugin %s", plugin_id)
|
||||
return False
|
||||
|
||||
plugin_object = self._plugin_registry.getPluginObject(plugin_id)
|
||||
# Scan plugin server data for plugin with the given id:
|
||||
for plugin in self._plugins_metadata:
|
||||
if plugin_id == plugin["id"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue