Mercurial > libervia-backend
comparison sat_frontends/jp/cmd_merge_request.py @ 3309:71761e9fb984
plugins tickets, merge-requests: `ticketsGet` and `mergeRequestsGet` serialisation:
those methods now return data serialised with `data_format.serialise`
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 16 Jul 2020 09:07:26 +0200 |
parents | 559a625a236b |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3308:384283adcce1 | 3309:71761e9fb984 |
---|---|
127 async def start(self): | 127 async def start(self): |
128 await common.fill_well_known_uri( | 128 await common.fill_well_known_uri( |
129 self, os.getcwd(), "merge requests", meta_map={}) | 129 self, os.getcwd(), "merge requests", meta_map={}) |
130 extra = {} | 130 extra = {} |
131 try: | 131 try: |
132 requests_data = await self.host.bridge.mergeRequestsGet( | 132 requests_data = data_format.deserialise( |
133 self.args.service, | 133 await self.host.bridge.mergeRequestsGet( |
134 self.args.node, | 134 self.args.service, |
135 self.args.max, | 135 self.args.node, |
136 self.args.items, | 136 self.args.max, |
137 "", | 137 self.args.items, |
138 extra, | 138 "", |
139 self.profile, | 139 extra, |
140 self.profile, | |
141 ) | |
140 ) | 142 ) |
141 except Exception as e: | 143 except Exception as e: |
142 self.disp(f"can't get merge request: {e}", error=True) | 144 self.disp(f"can't get merge request: {e}", error=True) |
143 self.host.quit(C.EXIT_BRIDGE_ERRBACK) | 145 self.host.quit(C.EXIT_BRIDGE_ERRBACK) |
144 | 146 |
145 if self.verbosity >= 1: | 147 if self.verbosity >= 1: |
146 whitelist = None | 148 whitelist = None |
147 else: | 149 else: |
148 whitelist = {"id", "title", "body"} | 150 whitelist = {"id", "title", "body"} |
149 for request_xmlui in requests_data[0]: | 151 for request_xmlui in requests_data['items']: |
150 xmlui = xmlui_manager.create(self.host, request_xmlui, whitelist=whitelist) | 152 xmlui = xmlui_manager.create(self.host, request_xmlui, whitelist=whitelist) |
151 await xmlui.show(values_only=True) | 153 await xmlui.show(values_only=True) |
152 self.disp("") | 154 self.disp("") |
153 self.host.quit(C.EXIT_OK) | 155 self.host.quit(C.EXIT_OK) |
154 | 156 |