summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-18 22:01:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-18 22:39:35 +0100
commitf8cf2cb58b80ce74f756a11a9773b6b0e78d51ee (patch)
tree46f71ff7fbed46b75c5f4dfa0b453fd3b796dc06 /lib/bb/event.py
parent6683338598ce97278f188fbcd780c3e3754e5b9a (diff)
downloadbitbake-contrib-f8cf2cb58b80ce74f756a11a9773b6b0e78d51ee.tar.gz
event/command: Allow UI to request the UI eventhander ID
The UI may want to change its event mask however to do this, it needs the event handler's ID. Tweak the code to allow this to be stored and add a command to query it. Use the new command in the process server backend. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index d5c5ef354..92ee3e92d 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -288,13 +288,13 @@ def set_eventfilter(func):
_eventfilter = func
def register_UIHhandler(handler, mainui=False):
- if mainui:
- global _uiready
- _uiready = True
bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1
_ui_handlers[_ui_handler_seq] = handler
level, debug_domains = bb.msg.constructLogOptions()
_ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains)
+ if mainui:
+ global _uiready
+ _uiready = _ui_handler_seq
return _ui_handler_seq
def unregister_UIHhandler(handlerNum, mainui=False):
@@ -305,6 +305,11 @@ def unregister_UIHhandler(handlerNum, mainui=False):
del _ui_handlers[handlerNum]
return
+def get_uihandler():
+ if _uiready is False:
+ return None
+ return _uiready
+
# Class to allow filtering of events and specific filtering of LogRecords *before* we put them over the IPC
class UIEventFilter(object):
def __init__(self, level, debug_domains):