From 4de9ee21f1fa4d04937cc7430fb1fc8b7a8f61e2 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Mon, 17 Jun 2013 12:11:51 +0100 Subject: knotty, xmlrpc: add observer-only mode I add an observer only mode for the knotty UI and the XMLRPC server that will allow the UI to register a callback with a server in order to receive events. The observer-UI is able to send read-only commands to the server, and also is able to register as an event handler. Read-only commands are the commands that do not change the state of the server and have been marked as such in the command module. The observer can switch to a full client if it calls addClient at any time, and the server has no other client running. Signed-off-by: Alexandru DAMIAN Signed-off-by: Richard Purdie --- bin/bitbake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/bitbake b/bin/bitbake index 1fac9feb2..e77266b4b 100755 --- a/bin/bitbake +++ b/bin/bitbake @@ -197,6 +197,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): parser.add_option("", "--remote-server", help = "Connect to the specified server", action = "store", dest = "remote_server", default = False) + parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client", + action = "store_true", dest = "observe_only", default = False) + options, targets = parser.parse_args(sys.argv) return options, targets[1:] @@ -269,6 +272,9 @@ def main(): if configParams.remote_server and configParams.servertype != "xmlrpc": sys.exit("FATAL: If '--remote-server' is defined, we must set the servertype as 'xmlrpc'.\n") + if configParams.observe_only and (not configParams.remote_server or configParams.bind): + sys.exit("FATAL: '--observe-only' can only be used by UI clients connecting to a server.\n") + if "BBDEBUG" in os.environ: level = int(os.environ["BBDEBUG"]) if level > configuration.debug: @@ -295,7 +301,7 @@ def main(): server = start_server(servermodule, configParams, configuration) else: # we start a stub server that is actually a XMLRPClient to - server = servermodule.BitBakeXMLRPCClient() + server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) server.saveConnectionDetails(configParams.remote_server) logger.removeHandler(handler) -- cgit 1.2.3-korg