]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
uievent: improve BBUIEventQueue code
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 6 Apr 2016 16:46:15 +0000 (17:46 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Apr 2016 22:00:10 +0000 (23:00 +0100)
Return value of self.BBServer.registerEventHandler differs between
jethro and master. To be able to build jethro toaster should be
able to communicate with jethro bitbake server i.e. it must work
with both old and new registerEventHandler call.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui/uievent.py

index 6b479bfa54c1de282d83d441dc8819fcb1fc0472..df093c53c0628f62eb9a078da33810e47f509818 100644 (file)
@@ -24,7 +24,7 @@ server and queue them for the UI to process. This process must be used to avoid
 client/server deadlocks.
 """
 
-import socket, threading, pickle
+import socket, threading, pickle, collections
 from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
 
 class BBUIEventQueue:
@@ -51,7 +51,13 @@ class BBUIEventQueue:
         # giving up
 
         for count_tries in range(5):
-            self.EventHandle, error = self.BBServer.registerEventHandler(self.host, self.port)
+            ret = self.BBServer.registerEventHandler(self.host, self.port)
+
+            if isinstance(ret, collections.Iterable):
+                self.EventHandle, error = ret
+            else:
+                self.EventHandle = ret
+                error = ""
 
             if self.EventHandle != None:
                 break