diff options
author | Martin Sivak <msivak@redhat.com> | 2007-12-05 10:36:27 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2007-12-05 10:36:27 +0100 |
commit | c88cc71e8cda8d92f32f55f36b060cd9f1902cd6 (patch) | |
tree | ae042a04151d7b46726b97973e26addf811e8c4f | |
parent | 11a4d15b9085601e8dc3c2fa9478f385037f2ef1 (diff) | |
download | firstaidkit-c88cc71e8cda8d92f32f55f36b060cd9f1902cd6.tar.gz firstaidkit-c88cc71e8cda8d92f32f55f36b060cd9f1902cd6.tar.xz firstaidkit-c88cc71e8cda8d92f32f55f36b060cd9f1902cd6.zip |
Reporting stuff, semantics and constants
-rw-r--r-- | tasker/reporting.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tasker/reporting.py b/tasker/reporting.py index b2286a9..1607e02 100644 --- a/tasker/reporting.py +++ b/tasker/reporting.py @@ -22,12 +22,18 @@ class Reports(object): """Instances of this class are used as reporting mechanism by which the plugins can comminucate back to whatever frontend we are using. - Message has four parts: + Message has five parts: origin - who sent the message (name of the plugin, Pluginsystem, ...) - semantics - what level does the message describe (system, plugin, task, ..) + semantics - what action does the message describe + (system, plugin, task, info, ..) importance - how is that message important (debug, info, error, ...) this must be number, possibly the same as in logging module message - the message itself + for INFO and ALERT semantics, this is an arbitrary text + for PROGRESS, this is (x,y) pair denoting progress + (on step x from y steps) or None to hide the progress + for others, the defined values are "start" and "stop" + the importance field should be ignored """ def __init__(self, maxsize=-1): @@ -44,3 +50,18 @@ class Reports(object): def error(self, message, origin, semantics): return self.put(message, origin, semantics, importance = logging.ERROR) +#semantics values +#first the "task" levels +FIRSTAIDKIT = 0 +TASKER = 1 +PLUGINSYSTEM = 2 +PLUGIN = 3 +FLOW = 4 +TASK = 5 + +#"gui" items +PROGRESS = 6 +INFO = 7 +ALERT = 8 + + |