-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
PluginManifest.__init__ initializes self._data = {}. Since _update_from_json only handles ModelObject, ModelCollection, ModelDictionary, and list for protected attributes, _data is silently skipped during deserialization.
# plugin_manifest.py
self._data = {} # ← plain dict, invisible to _update_from_jsonAs a result, Plugin.data always returns {} after get_object_model(), even when the JSON payload contains plugin data.
Suggested fix:
Change the initialization to ModelDictionary(False):
self._data = ModelDictionary(False)This makes is_model_object(_data) return True, so _update_from_json will call update_from_json() on it and populate the data correctly.
import re
from typing import List
from .sbc_permissions import SbcPermissions
from ..model_object import ModelObject
from ..model_dictionary import ModelDictionary
class PluginManifest(ModelObject):
"""Information about a third-party plugin"""
def __init__(self):
super(PluginManifest, self).__init__()
self._author = None
self._data = ModelDictionary(False)
self._dwc_dependencies = []
self._dwc_version = None
self._homepage = None
self._id = None
self._license = "LGPL-3.0-or-later"
self._name = None
self._rrf_version = None
self._sbc_auto_restart = False
self._sbc_config_files = []
self._sbc_dsf_version = None
self._sbc_executable = None
self._sbc_executable_arguments = []
self._sbc_extra_executables = []
self._sbc_output_redirected = None
self._sbc_package_dependencies = []
self._sbc_permissions = [] # Use a list instead of a set to keep insertion order (useful for json serialising)
self._sbc_plugin_dependencies = []
self._sbc_python_dependencies = []
self._sbc_required = None
self._tags = []
self._version = "1.0.0"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels