caldera
caldera copied to clipboard
Update Executor.HOOKS parsing to be more flexible
What problem are you trying to solve? Please describe.
The Builder Plugin uses the executor.HOOKS dictionary to hook into the link before it is executed and modify key items in the executor. The parsing of this dictionary is use-case specific and should be generalized to allow for more flexible plugin development (i.e. other plugins can easily add their own hooks to do similar behavior.
Current code:
if executor.HOOKS and executor.language and executor.language in executor.HOOKS:
await executor.HOOKS[executor.language](ability, executor)
The ideal solution: What should the feature should do?
Update the parsing of the executor.HOOKS dictionary in the planning service and operations api manager to support other HOOKS.
What category of feature is this?
- [ ] UI/UX
- [X] API
- [ ] Other
If you have code or pseudo-code please provide:
for hook, fcall in executor.HOOKS.items():
await fcall(ability, executor)
- [ YES] Willing to submit a pull request to implement this feature?
Additional context Add any other context or screenshots about the feature request here.
Thank you for your contribution!