diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-09-09 17:41:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-13 17:45:22 +0100 |
commit | a392877e57e07407be0e4fdf056d6e09c26f1ced (patch) | |
tree | d93275ac2d0b29e2f7d4886c20fa0aef85722fc8 /bitbake/lib/bb/server/xmlrpc.py | |
parent | dd36930f3f37b2e0e1258de28ac1b1fa99cf196f (diff) | |
download | poky-a392877e57e07407be0e4fdf056d6e09c26f1ced.tar.gz |
bitbake: bitbake: xmlrpc: delete unused code BitBakeUIEventServer
BitBakeUIEventServer is an unused class that pushes UI
events over a separate thread.
The current version of XMLRPC server works just fine with
the classic UI event handlers, so this class is not needed.
(Bitbake rev: 8e8e17631d790271b1be747c4b45059ec38ab606)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/xmlrpc.py')
-rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index a28672c447..8326623520 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
@@ -169,51 +169,6 @@ class BitBakeXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): | |||
169 | self.end_headers() | 169 | self.end_headers() |
170 | self.wfile.write(response) | 170 | self.wfile.write(response) |
171 | 171 | ||
172 | class BitBakeUIEventServer(threading.Thread): | ||
173 | class EventAdapter(): | ||
174 | """ | ||
175 | Adapter to wrap our event queue since the caller (bb.event) expects to | ||
176 | call a send() method, but our actual queue only has put() | ||
177 | """ | ||
178 | def __init__(self, notify): | ||
179 | self.queue = [] | ||
180 | self.notify = notify | ||
181 | self.qlock = threading.Lock() | ||
182 | |||
183 | def send(self, event): | ||
184 | self.qlock.acquire() | ||
185 | self.queue.append(event) | ||
186 | self.qlock.release() | ||
187 | self.notify.set() | ||
188 | |||
189 | def get(self): | ||
190 | self.qlock.acquire() | ||
191 | if len(self.queue) == 0: | ||
192 | self.qlock.release() | ||
193 | return None | ||
194 | e = self.queue.pop(0) | ||
195 | if len(self.queue) == 0: | ||
196 | self.notify.clear() | ||
197 | self.qlock.release() | ||
198 | return e | ||
199 | |||
200 | def __init__(self, connection): | ||
201 | self.connection = connection | ||
202 | self.notify = threading.Event() | ||
203 | self.event = BitBakeUIEventServer.EventAdapter(self.notify) | ||
204 | self.quit = False | ||
205 | threading.Thread.__init__(self) | ||
206 | |||
207 | def terminateServer(self): | ||
208 | self.quit = True | ||
209 | |||
210 | def run(self): | ||
211 | while not self.quit: | ||
212 | self.notify.wait(0.1) | ||
213 | evt = self.event.get() | ||
214 | if evt: | ||
215 | self.connection.event.sendpickle(pickle.dumps(evt)) | ||
216 | |||
217 | 172 | ||
218 | class XMLRPCProxyServer(BaseImplServer): | 173 | class XMLRPCProxyServer(BaseImplServer): |
219 | """ not a real working server, but a stub for a proxy server connection | 174 | """ not a real working server, but a stub for a proxy server connection |