1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 00:39:46 +00:00

bitbake none/xmlrpc servers: Only send pickled events to the xmlrpc server

Only the xmlrpc server needs pickled events. Use the function names
to signify this requirement.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-06-08 11:19:40 +01:00
parent cd3c4292e7
commit b34d66225f
3 changed files with 6 additions and 4 deletions
+4 -1
View File
@@ -119,7 +119,10 @@ def fire_ui_handlers(event, d):
# We use pickle here since it better handles object instances
# which xmlrpc's marshaller does not. Events *must* be serializable
# by pickle.
_ui_handlers[h].event.send((pickle.dumps(event)))
if hasattr(_ui_handlers[h].event, "sendpickle"):
_ui_handlers[h].event.sendpickle((pickle.dumps(event)))
else:
_ui_handlers[h].event.send(event)
except:
errors.append(h)
for h in errors:
+1 -2
View File
@@ -28,7 +28,6 @@
import time
import bb
import pickle
import signal
DEBUG = False
@@ -68,7 +67,7 @@ class BBUIEventQueue:
self.parent = parent
@staticmethod
def send(event):
bb.server.none.eventQueue.append(pickle.loads(event))
bb.server.none.eventQueue.append(event)
@staticmethod
def quit():
return
+1 -1
View File
@@ -76,7 +76,7 @@ class BBUIEventQueue:
self.host, self.port = server.socket.getsockname()
server.register_function( self.system_quit, "event.quit" )
server.register_function( self.send_event, "event.send" )
server.register_function( self.send_event, "event.sendpickle" )
server.socket.settimeout(1)
self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port)