Patchwork [bitbake-devel,00/11] Add PR service and integrate PKGV/PKGR from OE

login
register
mail settings
Submitter Joshua Lock
Date May 27, 2011, 9:01 p.m.
Message ID <1306530065.1747.14.camel@vorpal>
Download mbox | patch
Permalink /patch/4927/
State New, archived
Headers show

Comments

Joshua Lock - May 27, 2011, 9:01 p.m.
From 1618318f0a30847b08c158e7ac82f9043126144e Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:04:44 -0700
Subject: [PATCH 2/2] uievent: fix queueing of events for xmlrpc before
UI has
 loaded

The change to Queue up events before the UI is spawned 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>
---
 lib/bb/ui/uievent.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

self.BBServer.registerEventHandler(self.host, self.port)

Patch

diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py
index b404805..2fef4e4 100644
--- a/lib/bb/ui/uievent.py
+++ b/lib/bb/ui/uievent.py
@@ -63,17 +63,20 @@  class BBUIEventQueue:
 
     def queue_event(self, event):
         self.eventQueueLock.acquire()
-        self.eventQueue.append(pickle.loads(event))
+        self.eventQueue.append(event)
         self.eventQueueNotify.set()
         self.eventQueueLock.release()
 
+    def send_event(self, event):
+        self.queue_event(pickle.loads(event))
+
     def startCallbackHandler(self):
 
         server = UIXMLRPCServer()
         self.host, self.port = server.socket.getsockname()
 
         server.register_function( self.system_quit, "event.quit" )
-        server.register_function( self.queue_event, "event.send" )
+        server.register_function( self.send_event, "event.send" )
         server.socket.settimeout(1)
 
         self.EventHandle =