Skip to content

Shared data does not work if immutable #4

Description

@Quik2007

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions