Example:
plugin_name = 'example'
def plugin_init():
return True
def initialize(mod, req):
mod.last_result = None
def method(a, b):
mod.last_result = a + b
return a + b
mod.method = method
def finalize(mod, req, success):
pass
In this example, method takes 2 parameters and returns the sum. It also stores the sum as the property last_result.