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

login
register
mail settings
Submitter Dongxiao Xu
Date Jan. 6, 2012, 9:02 a.m.
Message ID <c9c075648019ee0f55b2ed916b40567307cd5674.1325840050.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/18631/
State New
Headers show

Comments

Dongxiao Xu - Jan. 6, 2012, 9:02 a.m.
Fire a sceneQueueTaskStarted event to notify the setscene tasks progress.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/event.py    |    2 +-
 lib/bb/runqueue.py |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)

Patch

diff --git a/lib/bb/event.py b/lib/bb/event.py
index ffd4213..10de984 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -223,7 +223,7 @@  class OperationProgress(Event):
         Event.__init__(self)
         self.current = current
         self.total = total
-        self.msg = msg + ": %s/%s (%.0f%%)" % (current, total, (current*1.0/total)*100);
+        self.msg = msg + ": %s/%s" % (current, total);
 
 class ConfigParsed(Event):
     """Configuration Parsing Complete"""
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 0e83d05..0ba414f 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1619,6 +1619,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
@@ -1686,6 +1689,13 @@  class runQueueTaskStarted(runQueueEvent):
         runQueueEvent.__init__(self, task, stats, rq)
         self.noexec = noexec
 
+class sceneQueueTaskStarted(runQueueTaskStarted):
+    """
+    Event notifing a setscene task was started
+    """
+    def __init__(self, task, stats, rq, noexec=False):
+        runQueueTaskStarted.__init__(self, task, stats, rq, noexec)
+
 class runQueueTaskFailed(runQueueEvent):
     """
     Event notifing a task failed