diff options
author | Ross Burton <ross.burton@intel.com> | 2016-09-16 12:32:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-21 21:58:05 +0100 |
commit | ac2ac312064cde8e2fb8fda956142d80a7b25219 (patch) | |
tree | 696b81ee132b1250165f6b1a4e5f4cba1993e0e2 /bitbake/lib/bb/ui/uihelper.py | |
parent | cb169d3ada8a00ab10c39d01e62cae77483a2d71 (diff) | |
download | poky-ac2ac312064cde8e2fb8fda956142d80a7b25219.tar.gz |
bitbake: uihelper: use elif instead of repeated if
(Bitbake rev: a1d6f6425cd9ef9e07344869817517172afd6e27)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/uihelper.py')
-rw-r--r-- | bitbake/lib/bb/ui/uihelper.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py index f64fa18ec2..fda7cc2c7c 100644 --- a/bitbake/lib/bb/ui/uihelper.py +++ b/bitbake/lib/bb/ui/uihelper.py | |||
@@ -35,25 +35,25 @@ class BBUIHelper: | |||
35 | self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time() } | 35 | self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time() } |
36 | self.running_pids.append(event.pid) | 36 | self.running_pids.append(event.pid) |
37 | self.needUpdate = True | 37 | self.needUpdate = True |
38 | if isinstance(event, bb.build.TaskSucceeded): | 38 | elif isinstance(event, bb.build.TaskSucceeded): |
39 | del self.running_tasks[event.pid] | 39 | del self.running_tasks[event.pid] |
40 | self.running_pids.remove(event.pid) | 40 | self.running_pids.remove(event.pid) |
41 | self.needUpdate = True | 41 | self.needUpdate = True |
42 | if isinstance(event, bb.build.TaskFailedSilent): | 42 | elif isinstance(event, bb.build.TaskFailedSilent): |
43 | del self.running_tasks[event.pid] | 43 | del self.running_tasks[event.pid] |
44 | self.running_pids.remove(event.pid) | 44 | self.running_pids.remove(event.pid) |
45 | # Don't add to the failed tasks list since this is e.g. a setscene task failure | 45 | # Don't add to the failed tasks list since this is e.g. a setscene task failure |
46 | self.needUpdate = True | 46 | self.needUpdate = True |
47 | if isinstance(event, bb.build.TaskFailed): | 47 | elif isinstance(event, bb.build.TaskFailed): |
48 | del self.running_tasks[event.pid] | 48 | del self.running_tasks[event.pid] |
49 | self.running_pids.remove(event.pid) | 49 | self.running_pids.remove(event.pid) |
50 | self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) | 50 | self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) |
51 | self.needUpdate = True | 51 | self.needUpdate = True |
52 | if isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted): | 52 | elif isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted): |
53 | self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1 | 53 | self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1 |
54 | self.tasknumber_total = event.stats.total | 54 | self.tasknumber_total = event.stats.total |
55 | self.needUpdate = True | 55 | self.needUpdate = True |
56 | if isinstance(event, bb.build.TaskProgress): | 56 | elif isinstance(event, bb.build.TaskProgress): |
57 | if event.pid > 0: | 57 | if event.pid > 0: |
58 | self.running_tasks[event.pid]['progress'] = event.progress | 58 | self.running_tasks[event.pid]['progress'] = event.progress |
59 | self.running_tasks[event.pid]['rate'] = event.rate | 59 | self.running_tasks[event.pid]['rate'] = event.rate |
@@ -62,4 +62,3 @@ class BBUIHelper: | |||
62 | def getTasks(self): | 62 | def getTasks(self): |
63 | self.needUpdate = False | 63 | self.needUpdate = False |
64 | return (self.running_tasks, self.failed_tasks) | 64 | return (self.running_tasks, self.failed_tasks) |
65 | |||