Skip to content

Commit

Permalink
Merge pull request #283 from TUM-Dev/fix/parser-fails-combining
Browse files Browse the repository at this point in the history
More reliable and simpler canteen list handling
  • Loading branch information
COM8 authored Feb 9, 2025
2 parents 83961c6 + 659bf02 commit f1a1d5f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion scripts/parse.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

CANTEEN_LIST=$(python3 src/main.py --canteens | python3 scripts/parse_canteen_list.py)
set -e

CANTEEN_LIST=$(python3 src/main.py --canteen-ids)
OUT_DIR="${OUT_DIR:-dist}"
LANGUAGE="${LANGUAGE_EAT_API:-DE}"

Expand Down
9 changes: 0 additions & 9 deletions scripts/parse_canteen_list.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def parse_cli_args():
action="store_true",
help="prints all available canteens formated as JSON",
)
group.add_argument(
"--canteen-ids",
action="store_true",
help="prints all available canteen IDs to stdout with a new line after each canteen",
)
parser.add_argument(
"--language",
help="The language to translate the dish titles to, "
Expand Down
4 changes: 4 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def main():
# print canteens
if args.canteens:
sys.exit(enum_json_creator.enum_to_api_representation_dict(list(Canteen)))
if args.canteen_ids:
for c in list(Canteen):
print(c.canteen_id)
sys.exit()

canteen = Canteen.get_canteen_by_str(args.canteen)
# get required parser
Expand Down

0 comments on commit f1a1d5f

Please sign in to comment.