'text' -> 'task' to match Todo spec

This commit is contained in:
samerbam 2023-08-24 21:41:24 -04:00
parent 3360a236fa
commit 45aac33f7c

View File

@ -69,7 +69,7 @@ class ThermalPrinter():
self.p.text("\n\n") self.p.text("\n\n")
# pass #TODO: add other greetings? # pass #TODO: add other greetings?
def print_todos(self, todos=[{"time": "1:00pm to 2:00pm", "text": "Read a book"}, {"time": "2:00pm to 3:00pm", "text": "Go for a walk"}, {"time": "3:00pm to 4:00pm", "text": "Walk to school while jumping on one leg and scratching your head."},]): def print_todos(self, todos=[{"time": "1:00pm to 2:00pm", "task": "Read a book"}, {"time": "2:00pm to 3:00pm", "task": "Go for a walk"}, {"time": "3:00pm to 4:00pm", "task": "Walk to school while jumping on one leg and scratching your head."},]):
self.p.set(align="left") self.p.set(align="left")
for x in self._parse_todos(todos): for x in self._parse_todos(todos):
# print(x) # print(x)
@ -225,7 +225,7 @@ class ThermalPrinter():
def _parse_todos(self, data): def _parse_todos(self, data):
out = [] out = []
for x in data: for x in data:
out.append(["O " + x["time"], x["text"]]) out.append(["O " + x["time"], x["task"]])
return out return out
#Return: ["□ 1:00pm to 2:00pm", "Read a book"] #Return: ["□ 1:00pm to 2:00pm", "Read a book"]