From 37e025f6f9c410005e0f1dee0767e38eaec01cbd Mon Sep 17 00:00:00 2001 From: Cristiana Voicu Date: Mon, 21 Jan 2013 16:40:07 +0200 Subject: bitbake: hob: Hob should display warnings generated during parsing -now Hob catches the warnings generated during parsing, and after the parsing is completed, if there are any warnings, it shows a bar that contains a message with how many warnings has encountered, and a button "View warnings" -when "View warnings" button is clicked, Hob shows a dialog with the warnings; if there more than 1 warning, you can use "Previous" and "Next" button to see them [YOCTO #3215] (Bitbake rev: d7b5311d35b3974398fecabfb5ecf1effa85c27e) Signed-off-by: Cristiana Voicu Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bitbake/lib/bb/ui/crumbs/hobeventhandler.py') diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index e690d4c99c..41022ef8eb 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py @@ -41,6 +41,9 @@ class HobHandler(gobject.GObject): "command-failed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING,)), + "parsing-warning" : (gobject.SIGNAL_RUN_LAST, + gobject.TYPE_NONE, + (gobject.TYPE_STRING,)), "sanity-failed" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, gobject.TYPE_INT)), @@ -95,6 +98,7 @@ class HobHandler(gobject.GObject): self.server = server self.error_msg = "" self.initcmd = None + self.parsing = False def set_busy(self): if not self.generating: @@ -207,6 +211,11 @@ class HobHandler(gobject.GObject): formatter = bb.msg.BBLogFormatter() msg = formatter.format(event) self.error_msg += msg + '\n' + elif event.levelno >= logging.WARNING and self.parsing == True: + formatter = bb.msg.BBLogFormatter() + msg = formatter.format(event) + warn_msg = msg + '\n' + self.emit("parsing-warning", warn_msg) elif isinstance(event, bb.event.TargetsTreeGenerated): self.current_phase = "data generation" @@ -249,6 +258,8 @@ class HobHandler(gobject.GObject): message["total"] = None message["title"] = "Parsing recipes" self.emit("parsing-started", message) + if isinstance(event, bb.event.ParseStarted): + self.parsing = True elif isinstance(event, (bb.event.ParseProgress, bb.event.CacheLoadProgress, bb.event.TreeDataPreparationProgress)): @@ -267,6 +278,8 @@ class HobHandler(gobject.GObject): message["total"] = event.total message["title"] = "Parsing recipes" self.emit("parsing-completed", message) + if isinstance(event, bb.event.ParseCompleted): + self.parsing = False elif isinstance(event, bb.event.NetworkTestFailed): self.emit("network-failed") self.run_next_command() -- cgit v1.2.3-54-g00ecf