aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/event.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-23 16:16:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-26 11:29:46 +0100
commit69aab78dd830b0ad570cf9b7bfe2da8e8b793e23 (patch)
tree8c799233df8ef5f3e9129da4c54241acea2c65f9 /bitbake/lib/bb/event.py
parentbfab986ccd59636d0b0e79309f020e55481b0567 (diff)
downloadopenembedded-core-contrib-69aab78dd830b0ad570cf9b7bfe2da8e8b793e23.tar.gz
bitbake: bitbake: Add ui event handlers filtering
Add functionality to allow UIs to update and change the types of events they recieve. To do this we need to add a new command and also need to be able to obtain the current event hander ID. In the case of xmlrpc, this is straightforward, in the case of the process server we need to save the result in a multiprocessing.Value() so we can retrive it. An excplit command was added to the server API to facilitate this. The same function can also be used to mask or unmask specific log messages, allowing the UI to optionally differ from the standard set of message filtering. Based upon work by Cristiana Voicu <cristiana.voicu@intel.com> (Bitbake rev: ba5a6c88785d9889d4172ec79937ac2a5555327e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r--bitbake/lib/bb/event.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 8ffd2c3e18..1169cbfb2b 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -193,7 +193,7 @@ def register(name, handler, mask=[]):
else:
_handlers[name] = handler
- if not mask:
+ if not mask or '*' in mask:
_catchall_handlers[name] = True
else:
for m in mask:
@@ -225,7 +225,7 @@ class UIEventFilter(object):
self.update(None, level, debug_domains)
def update(self, eventmask, level, debug_domains):
- self.eventmask = None
+ self.eventmask = eventmask
self.stdlevel = level
self.debug_domains = debug_domains
@@ -236,9 +236,20 @@ class UIEventFilter(object):
if event.name in self.debug_domains and event.levelno >= self.debug_domains[event.name]:
return True
return False
- # Implement other event masking here on self.eventmask
+ eid = str(event.__class__)[8:-2]
+ if eid not in self.eventmask:
+ return False
return True
+def set_UIHmask(handlerNum, level, debug_domains, mask):
+ if not handlerNum in _ui_handlers:
+ return False
+ if '*' in mask:
+ _ui_logfilters[handlerNum].update(None, level, debug_domains)
+ else:
+ _ui_logfilters[handlerNum].update(mask, level, debug_domains)
+ return True
+
def getName(e):
"""Returns the name of a class or class instance"""
if getattr(e, "__name__", None) == None: