Get the element that contains the output of the display function.
()
| 10 | |
| 11 | |
| 12 | async def get_display_container(): |
| 13 | """ |
| 14 | Get the element that contains the output of the display function. |
| 15 | """ |
| 16 | if RUNNING_IN_WORKER: |
| 17 | # Needed to ensure the DOM has time to catch up with the display calls |
| 18 | # made in the worker thread. |
| 19 | await asyncio.sleep(0.01) |
| 20 | py_display = web.page.find("script-py") |
| 21 | if len(py_display) == 1: |
| 22 | return py_display[0] |
| 23 | mpy_display = web.page.find("script-mpy") |
| 24 | if len(mpy_display) == 1: |
| 25 | return mpy_display[0] |
| 26 | return None |
| 27 | |
| 28 | |
| 29 | async def setup(): |
no test coverage detected