nice_gui.py 429 B

1234567891011121314
  1. import justpy as jp
  2. from elements import Column, Page
  3. page = Page()
  4. content = Column(page.view)
  5. jp.justpy(lambda: page.view, start_server=False)
  6. ui = jp.app
  7. # bind methods to simplify API -- justpy creates an app which must be found by uvicorn via string "module:attribute"
  8. for field in dir(content):
  9. if field[0] != '_' and callable(attr := getattr(content, field)):
  10. setattr(ui, field, attr)
  11. ui.timer = page.timer