diff options
Diffstat (limited to '')
-rw-r--r-- | sjdbmk/menuparser.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sjdbmk/menuparser.py b/sjdbmk/menuparser.py index 7413ff0..998272b 100644 --- a/sjdbmk/menuparser.py +++ b/sjdbmk/menuparser.py @@ -28,18 +28,10 @@ def menu_item_fix(s: str) -> Optional[str]: return None if s == "Condiments Selection\n葱,香菜,榨菜丝,老干妈,生抽,醋": return None - return ( - s.strip() - .replace("Biscuit /", "Biscuit/") - .replace("Juice /", "Juice/") - .replace(" \n", "\n") - .replace("\n ", "\n") - ) - - -def parse_meal_table( - rows: list[Any], initrow: int, t: list[str] -) -> dict[str, dict[str, list[str]]]: + return s.strip().replace("Biscuit /", "Biscuit/").replace("Juice /", "Juice/").replace(" \n", "\n").replace("\n ", "\n") + + +def parse_meal_table(rows: list[Any], initrow: int, t: list[str]) -> dict[str, dict[str, list[str]]]: assert rows[initrow + 1][1].value is None igroups = [] @@ -76,7 +68,9 @@ def parse_meal_table( return ret -def parse_menus(filename: str) -> dict[str, dict[str, dict[str, list[str]]]]: +def parse_menus( + filename: str, +) -> dict[str, dict[str, dict[str, list[str]]]]: wb = openpyxl.load_workbook(filename=filename) ws = wb["菜单"] rows = list(ws.iter_rows()) |