Patchwork [bitbake-devel,1/1] runqueue: fire sceneQueueTaskStarted event when a setscene queue starts

login
register
mail settings
Submitter Dongxiao Xu
Date Feb. 24, 2012, 1:31 a.m.
Message ID <d5e286c87af1c74f7ea968917d67a6f46898ccff.1330046167.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/21875/
State Accepted
Commit 7c07cc93d6558d7d9c3144b13493901b7ebae050
Headers show

Comments

Dongxiao Xu - Feb. 24, 2012, 1:31 a.m.
The current code prints a log when a setscene task starts, therefore
the progressbar in hob will not receive it. Use a sceneQueueTaskStarted
event instead.

Besides, change the sceneQueueTaskFailed event to inherit runQueueEvent
directly to avoid confusion to event receiver.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/runqueue.py |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
Richard Purdie - Feb. 24, 2012, 3:22 p.m.
On Fri, 2012-02-24 at 09:31 +0800, Dongxiao Xu wrote:
> The current code prints a log when a setscene task starts, therefore
> the progressbar in hob will not receive it. Use a sceneQueueTaskStarted
> event instead.
> 
> Besides, change the sceneQueueTaskFailed event to inherit runQueueEvent
> directly to avoid confusion to event receiver.
> 
> Signed-off-by: Shane Wang <shane.wang@intel.com>
> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
> ---
>  lib/bb/runqueue.py |   16 ++++++++++++++--
>  1 files changed, 14 insertions(+), 2 deletions(-)

Merged to master, thanks.

Richard

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index d1d9ad9..1959007 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1653,6 +1653,9 @@  class RunQueueExecuteScenequeue(RunQueueExecute):
                 self.task_skip(task)
                 return True
 
+            startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
+            bb.event.fire(startevent, self.cfgData)
+
             pid, pipein, pipeout = self.fork_off_task(fn, realtask, taskname)
 
             self.build_pids[pid] = task
@@ -1720,6 +1723,14 @@  class runQueueTaskStarted(runQueueEvent):
         runQueueEvent.__init__(self, task, stats, rq)
         self.noexec = noexec
 
+class sceneQueueTaskStarted(runQueueEvent):
+    """
+    Event notifing a setscene task was started
+    """
+    def __init__(self, task, stats, rq, noexec=False):
+        runQueueEvent.__init__(self, task, stats, rq)
+        self.noexec = noexec
+
 class runQueueTaskFailed(runQueueEvent):
     """
     Event notifing a task failed
@@ -1728,12 +1739,13 @@  class runQueueTaskFailed(runQueueEvent):
         runQueueEvent.__init__(self, task, stats, rq)
         self.exitcode = exitcode
 
-class sceneQueueTaskFailed(runQueueTaskFailed):
+class sceneQueueTaskFailed(runQueueEvent):
     """
     Event notifing a setscene task failed
     """
     def __init__(self, task, stats, exitcode, rq):
-        runQueueTaskFailed.__init__(self, task, stats, exitcode, rq)
+        runQueueEvent.__init__(self, task, stats, rq)
+        self.exitcode = exitcode
         self.taskstring = rq.rqdata.get_user_idstring(task, "_setscene")
 
 class runQueueTaskCompleted(runQueueEvent):