xref: /aosp_15_r20/external/mesa3d/bin/pick-ui.py (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard Worker#!/usr/bin/env python3
2*61046927SAndroid Build Coastguard Worker# Copyright © 2019-2020 Intel Corporation
3*61046927SAndroid Build Coastguard Worker
4*61046927SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining a copy
5*61046927SAndroid Build Coastguard Worker# of this software and associated documentation files (the "Software"), to deal
6*61046927SAndroid Build Coastguard Worker# in the Software without restriction, including without limitation the rights
7*61046927SAndroid Build Coastguard Worker# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8*61046927SAndroid Build Coastguard Worker# copies of the Software, and to permit persons to whom the Software is
9*61046927SAndroid Build Coastguard Worker# furnished to do so, subject to the following conditions:
10*61046927SAndroid Build Coastguard Worker
11*61046927SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be included in
12*61046927SAndroid Build Coastguard Worker# all copies or substantial portions of the Software.
13*61046927SAndroid Build Coastguard Worker
14*61046927SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*61046927SAndroid Build Coastguard Worker# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*61046927SAndroid Build Coastguard Worker# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17*61046927SAndroid Build Coastguard Worker# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18*61046927SAndroid Build Coastguard Worker# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19*61046927SAndroid Build Coastguard Worker# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20*61046927SAndroid Build Coastguard Worker# SOFTWARE.
21*61046927SAndroid Build Coastguard Worker
22*61046927SAndroid Build Coastguard Workerimport asyncio
23*61046927SAndroid Build Coastguard Worker
24*61046927SAndroid Build Coastguard Workerimport urwid
25*61046927SAndroid Build Coastguard Worker
26*61046927SAndroid Build Coastguard Workerfrom pick.ui import UI, PALETTE
27*61046927SAndroid Build Coastguard Worker
28*61046927SAndroid Build Coastguard Workerif __name__ == "__main__":
29*61046927SAndroid Build Coastguard Worker    u = UI()
30*61046927SAndroid Build Coastguard Worker    evl = urwid.AsyncioEventLoop(loop=asyncio.new_event_loop())
31*61046927SAndroid Build Coastguard Worker    loop = urwid.MainLoop(u.render(), PALETTE, event_loop=evl, handle_mouse=False)
32*61046927SAndroid Build Coastguard Worker    u.mainloop = loop
33*61046927SAndroid Build Coastguard Worker    loop.run()
34