From dda25ee4e1ca17cd333f10fcf0c825b60105da9c Mon Sep 17 00:00:00 2001 From: Martin Sivak Date: Mon, 5 May 2008 15:46:38 +0200 Subject: Use Issue reporting in plugins --- plugins/plugin_examples/sample2Plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/plugin_examples/sample2Plugin.py') 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): -- cgit