Updated ini to allow configuring host ip/port
This commit is contained in:
parent
71c1086e05
commit
2d1f504b67
|
@ -1,2 +1,4 @@
|
|||
[data]
|
||||
folder_location = z:\books\
|
||||
folder_location = z:\books\
|
||||
host = 127.0.0.1
|
||||
port = 8080
|
10
gui.py
10
gui.py
|
@ -1,5 +1,13 @@
|
|||
from nicegui import *
|
||||
from bookrequest import *
|
||||
import configparser
|
||||
config = configparser.ConfigParser()
|
||||
try:
|
||||
config.read('config.ini')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print('Config file not found. Please ensure conf.ini is in the same \
|
||||
location as bookrequest.py')
|
||||
def pass_command() -> None:
|
||||
if title.value != '':
|
||||
result = searchBook(title.value, unattended=True)
|
||||
|
@ -7,4 +15,4 @@ def pass_command() -> None:
|
|||
downloadBook(result)
|
||||
with ui.card().classes('absolute-center'):
|
||||
title = ui.input('Title').on('keydown.enter', pass_command)
|
||||
ui.run()
|
||||
ui.run(host=config['data']['host'],port=int(config['data']['port']))
|
Loading…
Reference in New Issue
Block a user