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

main
samerbam 1 year ago
parent 3360a236fa
commit 45aac33f7c

@ -69,7 +69,7 @@ class ThermalPrinter():
self.p.text("\n\n")
# 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")
for x in self._parse_todos(todos):
# print(x)
@ -225,7 +225,7 @@ class ThermalPrinter():
def _parse_todos(self, data):
out = []
for x in data:
out.append(["O " + x["time"], x["text"]])
out.append(["O " + x["time"], x["task"]])
return out
#Return: ["□ 1:00pm to 2:00pm", "Read a book"]

Loading…
Cancel
Save