From 2778a69e31715ecb7a2fafc986d82d6f7df3074b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 19 Jan 2010 09:56:25 +0000 Subject: event.py: Convert to using pickle for events and isinstance in knotty UI handler Signed-off-by: Richard Purdie --- lib/bb/event.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/bb/event.py') diff --git a/lib/bb/event.py b/lib/bb/event.py index 14384159d..8b4222bfc 100644 --- a/lib/bb/event.py +++ b/lib/bb/event.py @@ -24,6 +24,7 @@ BitBake build tools. import os, re import bb.utils +import pickle # This is the pid for which we should generate the event. This is set when # the runqueue forks off. @@ -62,9 +63,11 @@ def fire(event, d): errors = [] for h in _ui_handlers: #print "Sending event %s" % event - classid = "%s.%s" % (event.__class__.__module__, event.__class__.__name__) try: - _ui_handlers[h].event.send((classid, event)) + # 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))) except: errors.append(h) for h in errors: -- cgit 1.2.3-korg