11.4. How to implement a callback

If you want to implement a callback, you add a function corresponding to the callback name to your plugin module. For example, if you wanted to modify the Request object just before rendering, you'd implement cb_prepare like this:


def cb_prepare(args):
    pass

We're not doing anything here, but when the user sends a request and PyBlosxom handles it, this function in your plugin will get called when PyBlosxom runs the prepare callback.

Each callback passes in arguments through a single dictionary. Each callback passes in different arguments and expects different return values. Check the architecture chapter for a list of all the callbacks that are available, their arguments, and return values.