plugin interface changed: now we use classes (inherited by CryptoBoxPlugin) instead of plain scripts

added some log entries
use threading module instead of "fork" for background formatting
redirection for "network" plugin fixed
empty return value of plugins defaults to plugin overview page
This commit is contained in:
lars 2006-09-25 12:21:39 +00:00
parent 52ccaeb530
commit 56e954d1c4
11 changed files with 545 additions and 436 deletions

View file

@ -5,15 +5,20 @@ The following directory structure is required:
Python code interface:
def doAction(hdf, cbox, store=None, ???):
- create a class with the same name as the plugin - it has to inherit CryptoBoxPlugin
- function "doAction":
- this function will get called whenever this plugins is involved in a request
- all arguments should be optional (e.g. for displaying a form without previous input values)
- the argument "store" should be used to process a form submission (just a recommendation)
- if the processing failed for some reason (invalid input, ...), it should manually set the "Data.Warning" (resp. "Data.Error" or "Data.Success") to a value of your choice (preferably you may want to use messages of your namespace (e.g. "Plugins.PLUGINNAME.InvalidInput"))
- the return value should be the name of the template that should be displayed after processing (a template file in the plugin directory takes precedence over global template files)
- the return value may also be a dictionary with the following elements:
* template: the name of the template file (mandatory)
* generator: a generator object ("yield") - its content will replace every occourence of "<!-- CONTENT_DUMMY -->" in the template (useful for pages that are displayed step by step (as for formatting of filesystems))
- an empty (e.g. None) return value can be used to go return to the plugin page
def def getStatus(cbox):
- returns a string, that described a state connected to this plugin (e.g. the current date and time (for the "date" plugin)
- function "getStatus":
- returns a string, that describes a state connected to this plugin (e.g. the current date and time (for the "date" plugin))
Language file structure: