aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/ui/uihelper.py
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2011-11-28 14:32:40 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-24 17:51:20 +0000
commit4dacd29f9c957d20f4583330b51e5420f9c3338d (patch)
treeea13a7e1e08e68d2c6aaeafe34892a9603717307 /lib/bb/ui/uihelper.py
parent82482aae6f311c994275fb0b6b32d954bbfc78c3 (diff)
downloadbitbake-4dacd29f9c957d20f4583330b51e5420f9c3338d.tar.gz
Hob: A new implemetation (v2)
This commit implements a new design for hob Some of the new features: - Friendly new designed GUI. Quick response to user actions. - Two step builds support package generation and image generation. - Support running GUI seprarately from bitbake server. - Recipe/package selection and deselection. - Accurate customization for image contents and size. - Progress bars showing the parsing and build status. - Load/save user configurations from/into templates. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Liming An <limingx.l.an@intel.com> Signed-off-by: Fengxia Hua <fengxia.hua@intel.com> Designed-by: Belen Barros Pena <belen.barros.pena@intel.com>
Diffstat (limited to 'lib/bb/ui/uihelper.py')
-rw-r--r--lib/bb/ui/uihelper.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index 617d60db8..bbf5135b7 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -40,3 +40,45 @@ class BBUIHelper:
def getTasks(self):
self.needUpdate = False
return (self.running_tasks, self.failed_tasks)
+
+ def findServerDetails(self):
+ import sys
+ import optparse
+ from bb.server.xmlrpc import BitbakeServerInfo, BitBakeServerConnection
+ host = ""
+ port = 0
+ bind = ""
+ parser = optparse.OptionParser(
+ usage = """%prog -H host -P port -B bindaddr""")
+
+ parser.add_option("-H", "--host", help = "Bitbake server's IP address",
+ action = "store", dest = "host", default = None)
+
+ parser.add_option("-P", "--port", help = "Bitbake server's Port number",
+ action = "store", dest = "port", default = None)
+
+ parser.add_option("-B", "--bind", help = "Hob2 local bind address",
+ action = "store", dest = "bind", default = None)
+
+ options, args = parser.parse_args(sys.argv)
+ for key, val in options.__dict__.items():
+ if key == 'host' and val:
+ host = val
+ elif key == 'port' and val:
+ port = int(val)
+ elif key == 'bind' and val:
+ bind = val
+
+ if not host or not port or not bind:
+ parser.print_usage()
+ sys.exit(1)
+
+ serverinfo = BitbakeServerInfo(host, port)
+ clientinfo = (bind, 0)
+ connection = BitBakeServerConnection(serverinfo, clientinfo)
+
+ server = connection.connection
+ eventHandler = connection.events
+
+ return server, eventHandler, host, bind
+