diff options
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r-- | bitbake/lib/bb/event.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index d5c5ef3544..92ee3e92d4 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -288,13 +288,13 @@ def set_eventfilter(func): | |||
288 | _eventfilter = func | 288 | _eventfilter = func |
289 | 289 | ||
290 | def register_UIHhandler(handler, mainui=False): | 290 | def register_UIHhandler(handler, mainui=False): |
291 | if mainui: | ||
292 | global _uiready | ||
293 | _uiready = True | ||
294 | bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1 | 291 | bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1 |
295 | _ui_handlers[_ui_handler_seq] = handler | 292 | _ui_handlers[_ui_handler_seq] = handler |
296 | level, debug_domains = bb.msg.constructLogOptions() | 293 | level, debug_domains = bb.msg.constructLogOptions() |
297 | _ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains) | 294 | _ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains) |
295 | if mainui: | ||
296 | global _uiready | ||
297 | _uiready = _ui_handler_seq | ||
298 | return _ui_handler_seq | 298 | return _ui_handler_seq |
299 | 299 | ||
300 | def unregister_UIHhandler(handlerNum, mainui=False): | 300 | def unregister_UIHhandler(handlerNum, mainui=False): |
@@ -305,6 +305,11 @@ def unregister_UIHhandler(handlerNum, mainui=False): | |||
305 | del _ui_handlers[handlerNum] | 305 | del _ui_handlers[handlerNum] |
306 | return | 306 | return |
307 | 307 | ||
308 | def get_uihandler(): | ||
309 | if _uiready is False: | ||
310 | return None | ||
311 | return _uiready | ||
312 | |||
308 | # Class to allow filtering of events and specific filtering of LogRecords *before* we put them over the IPC | 313 | # Class to allow filtering of events and specific filtering of LogRecords *before* we put them over the IPC |
309 | class UIEventFilter(object): | 314 | class UIEventFilter(object): |
310 | def __init__(self, level, debug_domains): | 315 | def __init__(self, level, debug_domains): |