Display None when there is none
This commit is contained in:
parent
25d7d73255
commit
e0ced162f4
1 changed files with 2 additions and 0 deletions
|
@ -235,6 +235,8 @@ def resto_menu():
|
||||||
else:
|
else:
|
||||||
def table_for(kind):
|
def table_for(kind):
|
||||||
items = [meal for meal in resto["meals"] if meal["kind"] == kind]
|
items = [meal for meal in resto["meals"] if meal["kind"] == kind]
|
||||||
|
if len(items) == 0:
|
||||||
|
return "None :("
|
||||||
maxwidth = max(map(lambda item: len(item["name"]), items))
|
maxwidth = max(map(lambda item: len(item["name"]), items))
|
||||||
return "\n".join("{name: <{width}}{price}".format(
|
return "\n".join("{name: <{width}}{price}".format(
|
||||||
name=item["name"],
|
name=item["name"],
|
||||||
|
|
Loading…
Reference in a new issue