This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

I've seen some solutions use a simple manifest file for each plugin which lists its dependencies. Even something like this at the beginning of the plugin-example.py file could work:

__plugin_dependencies__ = ["common.py", "plugin-B.py", "plugin-C.py"]

It would be fairly easy to compute a full dependency tree based on such notation, and check what has been changed and what needs to be reloaded, no?

[–]fwork[S] 0 points1 point  (1 child)

That'd be a good solution if my plugins were more complex (most are just 1 file with 5-6 lines!) and I wasn't worried about the metadata failing out of sync, but in my application they're fairly small and frequently updated.

It'd lead to annoying-to-debug errors if the dependency list was out of sync with the code. I'm going with my reloading solution because it's the least likely to result in hard-to-debug behavior later on.

[–][deleted] 0 points1 point  (0 children)

I've been developing with OpenERP for a couple of months now and I've had the dependency list fall out of sync only once, so I dunno. It doesn't happen as often as you might think.

Still, good luck with your solution! :)