Plugin introspectable event interface
Hello,
I've just written a small script that parses a test suite file and plots the test cases in graph using the dependency information so it's clearly displayed which test case will be skipped in case of some other one fails.
I though it would be great to write a similar script that extracts checkbox plugin event interface (i.e. events to which a subscribe is subscribed via call_on method and events that might be fired using the fire reactor method) and displays a graph that shows the relationships between plugins. Of course, this won't explain when a plugin a fires an event and what do the callbacks methods upon even reception. However, it could be used to clarify the relationships established between callbacks. Unfortunately, this isn't currently possible because that information isn't externally available.
To be able to solve that problem, I thought about this approach:
- Store the list of events that might be received/fired by this plugin in a class variables (maybe this could be added through class decorators so that this information isn't only available programmatically, but also easy to find in code).
- Add a checks in code so that plugins cannot subscribe to or fire events that they have not declared as part of their interface
Please let me know what do you think about this idea. If it looks fine to you, then I might write some proof of concept code to see how it works.
Best regards,
Javier
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Checkbox Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Javier Collado
- Solved:
- Last query:
- Last reply: