diff options
| -rw-r--r-- | bitbake/lib/bb/command.py | 5 | ||||
| -rw-r--r-- | bitbake/lib/bb/event.py | 11 | ||||
| -rw-r--r-- | bitbake/lib/bb/server/process.py | 7 |
3 files changed, 19 insertions, 4 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 36891b923f..eb7c86f4fe 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
| @@ -238,6 +238,11 @@ class CommandsSync: | |||
| 238 | return command.cooker.matchFile(fMatch) | 238 | return command.cooker.matchFile(fMatch) |
| 239 | matchFile.needconfig = False | 239 | matchFile.needconfig = False |
| 240 | 240 | ||
| 241 | def getUIHandlerNum(self, command, params): | ||
| 242 | return bb.event.get_uihandler() | ||
| 243 | getUIHandlerNum.needconfig = False | ||
| 244 | getUIHandlerNum.readonly = True | ||
| 245 | |||
| 241 | def setEventMask(self, command, params): | 246 | def setEventMask(self, command, params): |
| 242 | handlerNum = params[0] | 247 | handlerNum = params[0] |
| 243 | llevel = params[1] | 248 | llevel = params[1] |
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): |
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index a8ba4681c6..cfcd76495c 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
| @@ -63,7 +63,12 @@ class ServerCommunicator(): | |||
| 63 | pass | 63 | pass |
| 64 | 64 | ||
| 65 | def getEventHandle(self): | 65 | def getEventHandle(self): |
| 66 | return self.event_handle.value | 66 | handle, error = self.runCommand(["getUIHandlerNum"]) |
| 67 | if error: | ||
| 68 | logger.error("Unable to get UI Handler Number: %s" % error) | ||
| 69 | raise BaseException(error) | ||
| 70 | |||
| 71 | return handle | ||
| 67 | 72 | ||
| 68 | class EventAdapter(): | 73 | class EventAdapter(): |
| 69 | """ | 74 | """ |
