diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-08 22:43:18 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-07-08 22:43:18 +0100 |
commit | 67d169aa1ce9ce435989e1416b94f64652b1883d (patch) | |
tree | cf732925f711141be34a5f5e857e7155c5abaa7d | |
parent | 41ff874c7fbd9c2ce6e15d4e4744015cd62d43b7 (diff) | |
download | openembedded-core-67d169aa1ce9ce435989e1416b94f64652b1883d.tar.gz openembedded-core-67d169aa1ce9ce435989e1416b94f64652b1883d.tar.bz2 openembedded-core-67d169aa1ce9ce435989e1416b94f64652b1883d.zip |
bitbake-dev: Fix to work with python 2.6 by dropping the now uneeded get_request overloaded function and using timeouts instead
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | bitbake-dev/lib/bb/xmlrpcserver.py | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/bitbake-dev/lib/bb/xmlrpcserver.py b/bitbake-dev/lib/bb/xmlrpcserver.py index 2a23436b65..557f69c996 100644 --- a/bitbake-dev/lib/bb/xmlrpcserver.py +++ b/bitbake-dev/lib/bb/xmlrpcserver.py @@ -115,7 +115,24 @@ class BitBakeXMLRPCServer(SimpleXMLRPCServer): """ self.quit = False while not self.quit: + print "Idle queue length %s" % len(self._idlefuns) + if len(self._idlefuns) == 0: + self.timeout = None + else: + self.timeout = 0 self.handle_request() + print "Idle timeout, running idle functions" + for function, data in self._idlefuns.items(): + try: + retval = function(self, data, False) + if not retval: + del self._idlefuns[function] + except SystemExit: + raise + except: + import traceback + traceback.print_exc() + pass # Tell idle functions we're exiting for function, data in self._idlefuns.items(): @@ -126,32 +143,3 @@ class BitBakeXMLRPCServer(SimpleXMLRPCServer): self.server_close() return - - def get_request(self): - """ - Get next request. Behaves like the parent class unless a waitpid callback - has been set. In that case, we regularly check waitpid when the server is idle - """ - while True: - # wait 500 ms for an xmlrpc request - if DEBUG: - print "DEBUG: select'ing 500ms waiting for an xmlrpc request..." - ifds, ofds, xfds = select.select([self.socket.fileno()], [], [], 0.5) - if ifds: - return self.socket.accept() - # call idle functions only if we're not shutting down atm to prevent a recursion - if not self.quit: - if DEBUG: - print "DEBUG: server is idle -- calling idle functions..." - for function, data in self._idlefuns.items(): - try: - retval = function(self, data, False) - if not retval: - del self._idlefuns[function] - except SystemExit: - raise - except: - import traceback - traceback.print_exc() - pass - |