beautify code
This commit is contained in:
parent
b74912e45d
commit
4abd520d86
1 changed files with 7 additions and 3 deletions
|
@ -68,7 +68,10 @@ def antilen(string: str):
|
|||
return 1 / len(string) if string else 0
|
||||
|
||||
|
||||
async def find_things(things: list[Thing], search_string: str, max_number: int = 10) -> Iterable[Thing]:
|
||||
async def find_things(
|
||||
things: list[Thing],
|
||||
search_string: str,
|
||||
max_number: int = 10) -> Iterable[Thing]:
|
||||
"""Gives things that the user might have searched for.
|
||||
|
||||
Args:
|
||||
|
@ -170,7 +173,7 @@ async def list_things(ui_element: nicegui.ui.element, things: Iterable[Thing]) -
|
|||
# supplying card and thing as default arguments makes it use the current
|
||||
# value instead of the value at the time of usage
|
||||
|
||||
def change_card(_, c: ui.element=card, p: Thing=thing):
|
||||
def change_card(_, c: ui.element = card, p: Thing = thing):
|
||||
show_thing_changer(c, p)
|
||||
with card:
|
||||
print(f"Create card {id(card)} for {thing.name}.")
|
||||
|
@ -402,7 +405,8 @@ def show_thing_changer(ui_element: nicegui.ui.element, thing: Thing) -> None:
|
|||
input_fields[f"sign.{sign_member}"] = ui.input(
|
||||
label="sign: " + sign_member,
|
||||
value=vars(thing.sign).get(sign_member, "")
|
||||
).props('autogrow dense'
|
||||
).props(
|
||||
'autogrow dense'
|
||||
).on_value_change(
|
||||
lambda e, m=sign_member: save_sign_value(e, m)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue