While Pluggy is quite cool, it can sometimes be a hindrance. The execution order of functions depends entirely on the order in which plugins are registered, and trying to fix that essentially breaks the hook system. Instead, we could remove Pluggy and manage the registration and calling of functions ourselves (what we already do for setup of the plugin). This way, we can control the execution order of each hook function directly through the character config YAML.
ToDo:
[x] Provide our own registration function. During registration, we check which Plugin ABC classes have been extended, allowing us to categorize the plugin according to each of the function calls’ abstract methods. In the end, we have a dictionary with the abstract method name as the key, holding a list of plugin classes (the extended ones).
[ ] #26
[x] #24
[x] Beside calling all functions of a type, and calling just one add the functionality to call a random one
[ ] #23
[x] go the simple route, call functions with getattr and the name of the function as string
[x] I am eager to build a function call builder something like:
PluginManager.call(“function_name”, parameters=1).all() Which then can be extended to add an .one(“PluginName”) or .one_random() function
go the simple route, call functions with getattr and the name of the function as string
I am eager to build a function call builder something like:
PluginManager.call(“function_name”, parameters=1).all() Which then can be extended to add an .one(“PluginName”) or .one_random() function
While Pluggy is quite cool, it can sometimes be a hindrance. The execution order of functions depends entirely on the order in which plugins are registered, and trying to fix that essentially breaks the hook system. Instead, we could remove Pluggy and manage the registration and calling of functions ourselves (what we already do for setup of the plugin). This way, we can control the execution order of each hook function directly through the character config YAML.
ToDo:
PluginManager.call(“function_name”, parameters=1).all()
Which then can be extended to add an.one(“PluginName”)
or.one_random()
function