diff options
Diffstat (limited to 'gui-project/main.py')
-rw-r--r-- | gui-project/main.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/gui-project/main.py b/gui-project/main.py index 7e52c77..d98b2c7 100644 --- a/gui-project/main.py +++ b/gui-project/main.py @@ -1,26 +1,10 @@ from nicegui import ui -from cards import CardUI, CardComponent -from flashcards import Session, SCHEDULERS +from main_ui import MainUI + +FLASHCARDS_ROOT="/home/andreear/git/schwiizertuutsch/flashcards" @ui.page("/") def main_page(): - with ui.row() as main_row: - start_button = ui.button("Start", on_click=lambda: start_session(main_row, start_button)) - - -async def start_session(parent_ui, start_button): - ui.notify("Started session") - session = Session("brutal", ["/home/andreear/git/schwiizertuutsch/flashcards/diverse.fcard"], "/home/andreear/git/flashcards/state.txt") - - start_button.set_visibility(False) - for i, card in enumerate(session.practice(20)): - # print(f"Showing card id {i}") - # print(f"Card front {card.front}") - # print(f"Card back {card.back}") - card_component = CardComponent(card.front, card.back) - card_ui = CardUI(parent_ui, card_component) - card_ui.show_front() - await card_ui.is_answered() - card_ui.hide_card() + MainUI() ui.run(port=3011)
\ No newline at end of file |