Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Simplify extensions/plugins/hooks/etc #129
Currently, to maintain a large application of extensions/plugins you generally need a 'bootstrap' file that registers handlers/etc, and then keep your actually libraries externally. Cement does this in namespace packages for 'ext' and 'lib'... but it gets messy.
Would like to consider adding a requirement for a 'load()' function in an extension/plugin modules. This way you can import classes/etc from the module... without actually registering/loading the extension/plugin. Something like:
from cement.core import handler, hook def my_post_setup_hook(app): pass class MyHandler(handler.CementHandler): pass def load(app): handler.register(MyHadler) hook.register('post_setup', my_post_setup_hook)
This way, I can still import MyHandler from the module if, for example, I want to sub-class it. But nothing is loaded. Can then move all decorators to 'cement.core.decorators' (maybe).