summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2011-06-14 15:12:16 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-08 17:38:42 +0100
commit4fadc30b92d42523fee013c168d47bc93dfe4fbd (patch)
treee37df0b79a8d6e20fd8b93bf065c9cd7bb033a5a /bitbake/lib/bb/ui
parent18ce7e2ef3a3b65bc0abca4f0135005249e6d2ca (diff)
downloadast2050-yocto-poky-4fadc30b92d42523fee013c168d47bc93dfe4fbd.zip
ast2050-yocto-poky-4fadc30b92d42523fee013c168d47bc93dfe4fbd.tar.gz
bitbake cooker/ui: handle cmd line parsing result by individual UI.
Changed the return result of "getCmdLineAction" to a dictionary {'action', 'msg'} to allow the individual UI decide how to handle the cmd line parsing result. (Bitbake rev: 521909d1350a415d19516aa1710041e30950c7cc) Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/depexp.py7
-rw-r--r--bitbake/lib/bb/ui/goggle.py6
-rw-r--r--bitbake/lib/bb/ui/knotty.py6
-rw-r--r--bitbake/lib/bb/ui/ncurses.py6
4 files changed, 20 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py
index dcf7e6e..b62adbf 100644
--- a/bitbake/lib/bb/ui/depexp.py
+++ b/bitbake/lib/bb/ui/depexp.py
@@ -199,10 +199,13 @@ class gtkthread(threading.Thread):
def main(server, eventHandler):
try:
cmdline = server.runCommand(["getCmdLineAction"])
- if not cmdline or cmdline[0] != "generateDotGraph":
+ if cmdline and not cmdline['action']:
+ print(cmdline['msg'])
+ return
+ elif not cmdline or (cmdline['action'] and cmdline['action'][0] != "generateDotGraph"):
print("This UI is only compatible with the -g option")
return
- ret = server.runCommand(["generateDepTreeEvent", cmdline[1], cmdline[2]])
+ ret = server.runCommand(["generateDepTreeEvent", cmdline['action'][1], cmdline['action'][2]])
if ret != True:
print("Couldn't run command! %s" % ret)
return
diff --git a/bitbake/lib/bb/ui/goggle.py b/bitbake/lib/bb/ui/goggle.py
index bd03d31..b2fd274 100644
--- a/bitbake/lib/bb/ui/goggle.py
+++ b/bitbake/lib/bb/ui/goggle.py
@@ -82,8 +82,12 @@ def main (server, eventHandler):
try:
cmdline = server.runCommand(["getCmdLineAction"])
if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
return 1
- ret = server.runCommand(cmdline)
+ elif not cmdline['action']:
+ print(cmdline['msg'])
+ return 1
+ ret = server.runCommand(cmdline['action'])
if ret != True:
print("Couldn't get default commandline! %s" % ret)
return 1
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 997eb3f..a4deb46 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -80,8 +80,12 @@ def main(server, eventHandler):
try:
cmdline = server.runCommand(["getCmdLineAction"])
if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
return 1
- ret = server.runCommand(cmdline)
+ elif not cmdline['action']:
+ print(cmdline['msg'])
+ return 1
+ ret = server.runCommand(cmdline['action'])
if ret != True:
print("Couldn't get default commandline! %s" % ret)
return 1
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py
index 469f1b7..8684697 100644
--- a/bitbake/lib/bb/ui/ncurses.py
+++ b/bitbake/lib/bb/ui/ncurses.py
@@ -232,8 +232,12 @@ class NCursesUI:
try:
cmdline = server.runCommand(["getCmdLineAction"])
if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
return
- ret = server.runCommand(cmdline)
+ elif not cmdline['action']:
+ print(cmdline['msg'])
+ return
+ ret = server.runCommand(cmdline['action'])
if ret != True:
print("Couldn't get default commandlind! %s" % ret)
return
OpenPOWER on IntegriCloud