ebook-downloader/gui.py

10 lines
357 B
Python
Raw Normal View History

2023-03-29 01:41:47 +00:00
from nicegui import *
from bookrequest import *
def pass_command() -> None:
if title.value != '':
result = searchBook(title.value, unattended=True)
ui.notify('Searching and Downloading Book!')
downloadBook(result)
with ui.card().classes('absolute-center'):
title = ui.input('Title').on('keydown.enter', pass_command)
ui.run()