If there is shared data in a plugin type, the items in the dictionary are just added as attributes to the plugins.
If a plugin overwrites this attribute, the item in the dictionary does not change.
Possible solution:
- Add a Data class (or maybe DataHolder)
- every plugin type can support multiple Data instances
In a plugin you could use:
self.data.some_var = "Foo"
self.data2.other_var = "Other value"
In the application you could use:
data = scarabaeus.Data()
data2 = scarabaeus.Data()
data.some_var = "Bar"
data2.other_var = "Some value"
plugin_type = scarabaeus.PluginType("Plugin", [data, data2], "plugins/")
plugin_type.load_all()
print(data.some_var, data2.other_var) # Foo, Other value
If there is shared data in a plugin type, the items in the dictionary are just added as attributes to the plugins.
If a plugin overwrites this attribute, the item in the dictionary does not change.
Possible solution:
In a plugin you could use:
In the application you could use: