diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-28 17:06:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-30 10:10:37 +0100 |
commit | fc49a6f00fc1ae3430ab3eb9615472efff0a7fce (patch) | |
tree | 974ebece6994013163d06bef990b9565e142b1ed /bitbake/lib/bb/server | |
parent | adba3edca22b46235bbeb02bbff1eeaa09bdeedf (diff) | |
download | poky-fc49a6f00fc1ae3430ab3eb9615472efff0a7fce.tar.gz |
bitbake: server/xmlrpc: Simlify featureset handling
Rather than passing featureset around various places where the data doesn't
really belong, run a command at connection time to set the appropriate
features. This is similar to what the process server does.
(Bitbake rev: c3b5cc5691291c74dd315c4439c80e0e4b2b5c1d)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index 46d074a738..bf867b584b 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
@@ -89,7 +89,7 @@ class BitBakeServerCommands(): | |||
89 | self.server = server | 89 | self.server = server |
90 | self.has_client = False | 90 | self.has_client = False |
91 | 91 | ||
92 | def registerEventHandler(self, host, port, featureset = []): | 92 | def registerEventHandler(self, host, port): |
93 | """ | 93 | """ |
94 | Register a remote UI Event Handler | 94 | Register a remote UI Event Handler |
95 | """ | 95 | """ |
@@ -99,13 +99,6 @@ class BitBakeServerCommands(): | |||
99 | if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]): | 99 | if (self.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]): |
100 | return None | 100 | return None |
101 | 101 | ||
102 | original_featureset = list(self.cooker.featureset) | ||
103 | for f in featureset: | ||
104 | self.cooker.featureset.setFeature(f) | ||
105 | |||
106 | if (original_featureset != list(self.cooker.featureset)): | ||
107 | self.cooker.reset() | ||
108 | |||
109 | self.event_handle = bb.event.register_UIHhandler(s) | 102 | self.event_handle = bb.event.register_UIHhandler(s) |
110 | return self.event_handle | 103 | return self.event_handle |
111 | 104 | ||
@@ -293,9 +286,15 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection): | |||
293 | return None | 286 | return None |
294 | self.transport.set_connection_token(token) | 287 | self.transport.set_connection_token(token) |
295 | 288 | ||
296 | self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo, self.featureset) | 289 | self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo) |
297 | for event in bb.event.ui_queue: | 290 | for event in bb.event.ui_queue: |
298 | self.events.queue_event(event) | 291 | self.events.queue_event(event) |
292 | |||
293 | _, error = self.connection.runCommand(["setFeatures", self.featureset]) | ||
294 | if error: | ||
295 | logger.error("Unable to set the cooker to the correct featureset: %s" % error) | ||
296 | raise BaseException(error) | ||
297 | |||
299 | return self | 298 | return self |
300 | 299 | ||
301 | def removeClient(self): | 300 | def removeClient(self): |