Fix: Reading subject infos from csv file
This commit is contained in:
parent
e6595b7041
commit
5bf9d8b7c1
15
Makefile
15
Makefile
@ -1,7 +1,12 @@
|
|||||||
EXAMPLE=simple
|
docker-build-simple:
|
||||||
docker-build:
|
docker build -f Dockerfile.simple -t simple .
|
||||||
docker build -f Dockerfile.$(EXAMPLE) -t $(EXAMPLE) .
|
|
||||||
|
|
||||||
docker-test: docker-build
|
docker-simple: docker-build-simple
|
||||||
docker run $(EXAMPLE) sh -c "bopytex -q 2 tpl_example.tex && cat 1_example.tex"
|
docker run simple sh -c "bopytex -q 2 tpl_example.tex && cat 1_example.tex"
|
||||||
|
|
||||||
|
docker-build-usecase:
|
||||||
|
docker build -f Dockerfile.usecase -t usecase .
|
||||||
|
|
||||||
|
docker-usecase: docker-build-usecase
|
||||||
|
docker run usecase sh -c "bopytex -s students.csv tpl_example.tex && cat 1_example.tex"
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ def planner(options: dict) -> list[Task]:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
with open(students_csv, "r") as csv_file:
|
with open(students_csv, "r") as csv_file:
|
||||||
infos = csv.DictReader(csv_file)
|
reader = csv.DictReader(csv_file)
|
||||||
|
infos = [r for r in reader]
|
||||||
options["subjects"] = build_subject_list_from_infos(infos)
|
options["subjects"] = build_subject_list_from_infos(infos)
|
||||||
|
|
||||||
return tasks_builder(options)
|
return tasks_builder(options)
|
||||||
|
6
example/usecase/students.csv
Normal file
6
example/usecase/students.csv
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
"Name","Age","Email","fraction level","calculus level"
|
||||||
|
"Spike Tucker","22","s.tucker@randatmail.com","7","3"
|
||||||
|
"Martin Payne","21","m.payne@randatmail.com","7","3"
|
||||||
|
"Kimberly Baker","20","k.baker@randatmail.com","1","8"
|
||||||
|
"Emma Bailey","29","e.bailey@randatmail.com","2","5"
|
||||||
|
"Nicholas Taylor","28","n.taylor@randatmail.com","3","3"
|
|
Loading…
Reference in New Issue
Block a user