summaryrefslogtreecommitdiffstats
path: root/tasker
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2008-01-02 11:02:53 +0100
committerMartin Sivak <msivak@redhat.com>2008-01-02 11:02:53 +0100
commitf2b23461dfd642b203bb4f02d01b9938e8b2f804 (patch)
tree77b0fe872e6ed3cb4ec08c787e717c04351e9890 /tasker
parent2a4335b0c2e5e071190afe24d24e5ea99c7553b5 (diff)
downloadfirstaidkit-f2b23461dfd642b203bb4f02d01b9938e8b2f804.tar.gz
firstaidkit-f2b23461dfd642b203bb4f02d01b9938e8b2f804.tar.xz
firstaidkit-f2b23461dfd642b203bb4f02d01b9938e8b2f804.zip
Add message types for structured stuff like trees and tables.
Diffstat (limited to 'tasker')
-rw-r--r--tasker/reporting.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tasker/reporting.py b/tasker/reporting.py
index 1fa60f2..0337340 100644
--- a/tasker/reporting.py
+++ b/tasker/reporting.py
@@ -34,6 +34,8 @@ PROGRESS = 2
INFO = 3
ALERT = 4
EXCEPTION = 5
+TABLE = 6 #types for arbitrary table-like organized iterables
+TREE = 7 #nested iterables organized as tree
END = 1000 #End of operations, final message
class Reports(object):
@@ -43,7 +45,7 @@ class Reports(object):
Message has four parts:
origin - who sent the message (name of the plugin, Pluginsystem, ...)
semantics - what action does the message describe
- (INFO, ALERT, PROGRESS, START, STOP)
+ (INFO, ALERT, PROGRESS, START, STOP, DATA, END)
importance - how is that message important (debug, info, error, ...)
this must be number, possibly the same as in logging module
message - the message itself
@@ -81,6 +83,12 @@ class Reports(object):
def info(self, message, origin, importance = logging.INFO):
return self.put(message, origin, INFO, importance = importance)
+
+ def tree(self, message, origin, importance = logging.INFO):
+ return self.put(message, origin, TREE, importance = importance)
+ def table(self, message, origin, importance = logging.INFO):
+ return self.put(message, origin, TABLE, importance = importance)
+
def alert(self, message, origin, importance = logging.WARNING):
return self.put(message, origin, ALERT, importance = importance)
def exception(self, message, origin, importance = logging.ERROR):