Bundles are reusable components that can be easily swapped between applications. The only requirement for a bundle is that it has a callable that accepts the application instance. This setup function is much like the setup function passed to an application on initial setup. The bundle’s setup function is called during application setup and sets up the functionality.
Add a setup callable to be called on startup by the application.
This method is used to add pluggable capability to the application. For example, plugin A can load plugin B by importing and adding its setup func like so:
>>> from a import setup_a
>>> app.add_setup(setup_a)
Or in a real example:
>>> from glashammer.bundles.auth import setup_auth
>>> app.add_setup(setup_auth)
Will initialize the auth bundle for the application.
The following bundles are shipped with Glashammer, expect this list to increase, as we are adding functionality as required.
Note
If you have a bundle you have written, and reused, the chances are that others will find it useful, too, so please tell us about it for inclusion into the source.