Mercurial > libervia-web
comparison libervia/web/pages/lists/view/_browser/__init__.py @ 1531:d7c78722e4f8
browser (cache): make `fill_identities` async + use `json` module:
- `json` module has been greatly improved in Brython, the former workaround is not needed
anymore.
- `fill_identities` is now async so an async method can wait for it to complete
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 22 Jun 2023 16:35:34 +0200 |
parents | eb00d593801d |
children | 3baf53a3590d |
comparison
equal
deleted
inserted
replaced
1530:b338c31d5251 | 1531:d7c78722e4f8 |
---|---|
1 from browser import window, document, aio, bind | 1 from browser import aio, window, document, aio, bind |
2 from invitation import InvitationManager | 2 from invitation import InvitationManager |
3 from javascript import JSON | 3 from javascript import JSON |
4 from bridge import Async as Bridge, BridgeException | 4 from bridge import Async as Bridge, BridgeException |
5 import dialog | 5 import dialog |
6 | 6 |
31 else: | 31 else: |
32 name = name.strip() | 32 name = name.strip() |
33 if name: | 33 if name: |
34 pubsub_data['name'] = name | 34 pubsub_data['name'] = name |
35 manager = InvitationManager("pubsub", pubsub_data) | 35 manager = InvitationManager("pubsub", pubsub_data) |
36 manager.attach(affiliations=affiliations) | 36 aio.run(manager.attach(affiliations=affiliations)) |
37 | 37 |
38 | 38 |
39 async def on_delete(evt): | 39 async def on_delete(evt): |
40 item_elt = evt.target.closest(".item") | 40 item_elt = evt.target.closest(".item") |
41 if item_elt is None: | 41 if item_elt is None: |