summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2007-11-20 13:38:44 +0100
committerJoel Andres Granados <jgranado@redhat.com>2007-11-20 13:38:44 +0100
commit8aea1940b27a5a25c96d3aba3b8acd5f2d76c3f1 (patch)
tree80cf71aa73fccc02b1f6ef92744827410faaadf8
parent730b9871f6c93ebc5da1883824c5db93575636f3 (diff)
downloadfirstaidkit-8aea1940b27a5a25c96d3aba3b8acd5f2d76c3f1.tar.gz
firstaidkit-8aea1940b27a5a25c96d3aba3b8acd5f2d76c3f1.tar.xz
firstaidkit-8aea1940b27a5a25c96d3aba3b8acd5f2d76c3f1.zip
I Think its better this way.
-rw-r--r--PLUGINS30
1 files changed, 19 insertions, 11 deletions
diff --git a/PLUGINS b/PLUGINS
index a55362e..76bccd2 100644
--- a/PLUGINS
+++ b/PLUGINS
@@ -31,18 +31,23 @@ and the system cannot end in some undeterministic state.
Python modules (both py and binary)
------------------------------------
+A plugin for the FirstAidKit must inherite from the tasker.Plugin class.
+It must also implement the mandatory plugin steps. The tasker.Plugin
+parent will provide a default flow that will use the functions defined
+by the plugin developer. Moreover, for the mandatory steps, the plugin
+developer must garantee that the function will return a valid return
+class (more on return class further on). In other words, the function
+must return one of the possible return classes included in the default
+flow.
+
+tasker.Plugin defines:
+nextstep() -- This is used to return the next function that should be
+ executed. __iter__() is not used because there is no
+ control over __iter__() in an iteration. nextstep()
+ allows us execution of the flow without the need for an
+ iteration. However the iteratior is present in the
+ class and can be used accordinly.
-Python modules MUST export function get_plugin(), which returns
-a new instance of the plugin.
-
-It is strongly advised to base (derive from) the plugin on existing
-class tasker.DummyPlugin. This class defines all the necessary stuff
-to do nothing in the correct way.
-
-The most important stuff you have to support in plugin are:
-
-nextstep() -- returns name of the next step during automated processing
- or None when finished
__iter__() and next() -- iterator protocol, works in the same way as
nextstep() but end with StopIteration exception
@@ -53,6 +58,9 @@ info() -- returns tuple of strings defined as (name of plugin, version, author)
And of course the steps itself. They are defined as methods with the same names
as used in actions().
+Return Class
+------------
+
Arbitrary executable modules
----------------------------