Skip to content

Menu parser#35

Open
DefEnge wants to merge 4 commits into
mainfrom
MenuParser
Open

Menu parser#35
DefEnge wants to merge 4 commits into
mainfrom
MenuParser

Conversation

@DefEnge
Copy link
Copy Markdown
Collaborator

@DefEnge DefEnge commented Mar 6, 2023

initial set up for the menù

Comment thread module/menuparser/menu.py
case _:
return "ERROR the day selected doesn't exist"

return menu_of_the_day
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this entire function is not necessary

Comment thread module/menuparser/menu.py Outdated
Comment on lines +26 to +27
i_str = str(i)
current_course = w_s[table_char + i_str].value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
i_str = str(i)
current_course = w_s[table_char + i_str].value
current_course = w_s[table_char + str(i)].value

Comment thread module/menuparser/menu.py
Comment on lines +25 to +28
for i in range (4, 15):
i_str = str(i)
current_course = w_s[table_char + i_str].value
menu_of_the_day.append(current_course)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, if you want:

Suggested change
for i in range (4, 15):
i_str = str(i)
current_course = w_s[table_char + i_str].value
menu_of_the_day.append(current_course)
menu_of_the_day = [w_s[table_char + str(i)].value for i in range (4, 15)]
return menu_of_the_day

removing the menu_of_the_day = [] at the top of the function

Comment thread module/menuparser/menu.py Outdated
Comment on lines +67 to +68
for i in range(len(menu_list)):
print(menu_list[i])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i in range(len(menu_list)):
print(menu_list[i])
for menu_item in menu_list:
print(menu_item)

Comment thread module/menuparser/menu.py Outdated
Comment on lines +71 to +75
#Calls to the functions for testing
table = open_menu(MENU_PATH)
menu = scroll_table(table, 1)

print_function(menu)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could wrap this into a if __name__ == "__main__":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants