summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-01-05 19:23:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-12 11:43:50 +0000
commit749ca687091d6ee7f92fce4c385a7ff4bd2636aa (patch)
tree8048dfcd1dc0db115be4d990a13f18e241402c03 /bitbake/lib/bb/ui
parentf5a1f1d7f0b51d0936edd74def07f07a2342ad17 (diff)
downloadpoky-749ca687091d6ee7f92fce4c385a7ff4bd2636aa.tar.gz
bitbake/uievent: fix queueing of events for xmlrpc before UI has loaded
The recent change to Queue up events before the UI is spawned (in 26eda933379801ef1c8b4b09e67d14f498cd3813) broke the xmlrpc server because the uievent implementation of BBUIEventQueue expects pickled strings for its queue_event() method. This is because the RPC exposed event.send() method must accept pickled strings, but for xmlrpc event.send() is just mapped to queue_event(). Work around this by adding a send_event method which unpickles strings and hands them off to queue_event() which can then be used for the remapping. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/uievent.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/uievent.py b/bitbake/lib/bb/ui/uievent.py
index b404805d81..2fef4e4659 100644
--- a/bitbake/lib/bb/ui/uievent.py
+++ b/bitbake/lib/bb/ui/uievent.py
@@ -63,17 +63,20 @@ class BBUIEventQueue:
63 63
64 def queue_event(self, event): 64 def queue_event(self, event):
65 self.eventQueueLock.acquire() 65 self.eventQueueLock.acquire()
66 self.eventQueue.append(pickle.loads(event)) 66 self.eventQueue.append(event)
67 self.eventQueueNotify.set() 67 self.eventQueueNotify.set()
68 self.eventQueueLock.release() 68 self.eventQueueLock.release()
69 69
70 def send_event(self, event):
71 self.queue_event(pickle.loads(event))
72
70 def startCallbackHandler(self): 73 def startCallbackHandler(self):
71 74
72 server = UIXMLRPCServer() 75 server = UIXMLRPCServer()
73 self.host, self.port = server.socket.getsockname() 76 self.host, self.port = server.socket.getsockname()
74 77
75 server.register_function( self.system_quit, "event.quit" ) 78 server.register_function( self.system_quit, "event.quit" )
76 server.register_function( self.queue_event, "event.send" ) 79 server.register_function( self.send_event, "event.send" )
77 server.socket.settimeout(1) 80 server.socket.settimeout(1)
78 81
79 self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port) 82 self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port)