It's possible to extend the API with new functions from :doc:`custom plugins </python/intro>`.
In order for the API plugin to know about this plugin it must implement the
interface IApiCallHandler
from api import IApiCallHandler from base import Plugin, implements class HelloWorld(Plugin): implements(IApiCallHandler)
Use the decorator @apicall
on the function you want to export. This example
exports the function helloworld/foobar
:
@apicall('helloworld', 'foobar') def myfunction(self, arg1, arg2):
from api import IApiCallHandler, apicall from base import Plugin, implements class HelloWorld(Plugin): implements(IApiCallHandler) @apicall('helloworld', 'foobar') def myfunction(self, arg1, arg2): """ Docs for the function goes here """ return True