comparison sat_frontends/jp/output_xmlui.py @ 3040:fee60f17ebac

jp: jp asyncio port: /!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\ This patch implements the port of jp to asyncio, so it is now correctly using the bridge asynchronously, and it can be used with bridges like `pb`. This also simplify the code, notably for things which were previously implemented with many callbacks (like pagination with RSM). During the process, some behaviours have been modified/fixed, in jp and backends, check diff for details.
author Goffi <goffi@goffi.org>
date Wed, 25 Sep 2019 08:56:41 +0200
parents ab2696e34d29
children 9d0df638c8b4
comparison
equal deleted inserted replaced
3039:a1bc34f90fa5 3040:fee60f17ebac
37 host.register_output(C.OUTPUT_XMLUI, "simple", self.xmlui, default=True) 37 host.register_output(C.OUTPUT_XMLUI, "simple", self.xmlui, default=True)
38 host.register_output( 38 host.register_output(
39 C.OUTPUT_LIST_XMLUI, "simple", self.xmlui_list, default=True 39 C.OUTPUT_LIST_XMLUI, "simple", self.xmlui_list, default=True
40 ) 40 )
41 41
42 def xmlui(self, data): 42 async def xmlui(self, data):
43 xmlui = xmlui_manager.create(self.host, data) 43 xmlui = xmlui_manager.create(self.host, data)
44 xmlui.show(values_only=True, read_only=True) 44 await xmlui.show(values_only=True, read_only=True)
45 self.host.disp("") 45 self.host.disp("")
46 46
47 def xmlui_list(self, data): 47 async def xmlui_list(self, data):
48 for d in data: 48 for d in data:
49 self.xmlui(d) 49 await self.xmlui(d)