Mercurial > libervia-backend
comparison sat_frontends/jp/cmd_invitation.py @ 3339:c560aae54f5f
jp (invitation): `delete` implementation
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 13 Aug 2020 23:46:18 +0200 |
parents | 559a625a236b |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3338:203a491fcd86 | 3339:c560aae54f5f |
---|---|
211 self.host.quit(C.EXIT_BRIDGE_ERRBACK) | 211 self.host.quit(C.EXIT_BRIDGE_ERRBACK) |
212 | 212 |
213 await self.output_data(invitation_data, jid_) | 213 await self.output_data(invitation_data, jid_) |
214 | 214 |
215 | 215 |
216 class Delete(base.CommandBase): | |
217 def __init__(self, host): | |
218 base.CommandBase.__init__( | |
219 self, | |
220 host, | |
221 "delete", | |
222 use_profile=False, | |
223 help=_("delete guest account"), | |
224 ) | |
225 | |
226 def add_parser_options(self): | |
227 self.parser.add_argument( | |
228 "id", help=_("invitation UUID") | |
229 ) | |
230 | |
231 async def start(self): | |
232 try: | |
233 await self.host.bridge.invitationDelete( | |
234 self.args.id, | |
235 ) | |
236 except Exception as e: | |
237 self.disp(msg=_(f"can't delete guest account: {e}"), error=True) | |
238 self.host.quit(C.EXIT_BRIDGE_ERRBACK) | |
239 | |
240 self.host.quit() | |
241 | |
242 | |
216 class Modify(base.CommandBase): | 243 class Modify(base.CommandBase): |
217 def __init__(self, host): | 244 def __init__(self, host): |
218 base.CommandBase.__init__( | 245 base.CommandBase.__init__( |
219 self, host, "modify", use_profile=False, help=_("modify existing invitation") | 246 self, host, "modify", use_profile=False, help=_("modify existing invitation") |
220 ) | 247 ) |
337 await self.output(data) | 364 await self.output(data) |
338 self.host.quit() | 365 self.host.quit() |
339 | 366 |
340 | 367 |
341 class Invitation(base.CommandBase): | 368 class Invitation(base.CommandBase): |
342 subcommands = (Create, Get, Modify, List) | 369 subcommands = (Create, Get, Delete, Modify, List) |
343 | 370 |
344 def __init__(self, host): | 371 def __init__(self, host): |
345 super(Invitation, self).__init__( | 372 super(Invitation, self).__init__( |
346 host, | 373 host, |
347 "invitation", | 374 "invitation", |