summaryrefslogtreecommitdiffstats
path: root/plugins/plugin_examples/sample2Plugin.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2008-05-05 15:46:38 +0200
committerMartin Sivak <msivak@redhat.com>2008-05-05 15:46:38 +0200
commitdda25ee4e1ca17cd333f10fcf0c825b60105da9c (patch)
tree38b57154fda72b4d2bf07bced54c3fe9be7924b3 /plugins/plugin_examples/sample2Plugin.py
parentc227496fa86c36762018c2a8219f2136ec63fa10 (diff)
downloadfirstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.gz
firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.xz
firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.zip
Use Issue reporting in plugins
Diffstat (limited to 'plugins/plugin_examples/sample2Plugin.py')
-rw-r--r--plugins/plugin_examples/sample2Plugin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/plugin_examples/sample2Plugin.py b/plugins/plugin_examples/sample2Plugin.py
index e48389a..aab679c 100644
--- a/plugins/plugin_examples/sample2Plugin.py
+++ b/plugins/plugin_examples/sample2Plugin.py
@@ -17,6 +17,8 @@
from pyfirstaidkit.plugins import Plugin,Flow
from pyfirstaidkit.returns import *
+from pyfirstaidkit.issue import SimpleIssue
+from pyfirstaidkit.reporting import PLUGIN
class Sample2Plugin(Plugin):
"""This plugin will defin one more function and use it in a newly defined fix flow."""
@@ -41,8 +43,10 @@ class Sample2Plugin(Plugin):
def __init__(self, *args, **kwargs):
Plugin.__init__(self, *args, **kwargs)
+ self._issue = SimpleIssue(self.name, self.description)
def prepare(self):
+ self._issue.set(reporting = self._reporting, origin = self, level = PLUGIN)
self._result=ReturnSuccess
def clean(self):
@@ -55,9 +59,11 @@ class Sample2Plugin(Plugin):
self._result=ReturnSuccess
def diagnose(self):
+ self._issue.set(detected = True, happened = True, reporting = self._reporting, origin = self, level = PLUGIN)
self._result=ReturnFailure
def fix(self):
+ self._issue.set(fixed = True, reporting = self._reporting, origin = self, level = PLUGIN)
self._result=ReturnSuccess
def extraStep(self):