simplify simplify simplify

This commit is contained in:
samerbam 2023-08-23 13:01:29 -04:00
parent bd816a6599
commit 79eb6a4973

View File

@ -87,9 +87,14 @@ class ThermalPrinter():
todo_text = textwrap.wrap(x[1], todo_text_max_len)
# t_text = textwrap.wrap()
self.p.text(" " + todo_text[0])
self.p.text(" " + todo_text.pop(0))
for t in todo_text[1:]:
todo_text = textwrap.wrap(' '.join(todo_text), 32)
for t in todo_text:
self.p.text(t + "\n")
# for t in todo_text[1:]:
# self.p.text("" + " "*(len(x[0])+1) )
# for s in range((len(x[0])+1)):
# self.p.text(" ")
@ -97,7 +102,7 @@ class ThermalPrinter():
# self.p.text( (" "*(32-(len(x[0]))))+t+"\n" )
# self.p.text(' '*(32-len(x[0])-len(t))+t+"\n" )
self.p.text(' '*(32-len(t))+t+"\n" )
# self.p.text(' '*(32-len(t))+t+"\n" )
#32-len(x[0])len(text)
@ -189,7 +194,7 @@ class ThermalPrinter():
print('end 2')
print('start 3')
self.print_sudoku()
# self.print_sudoku()
print('end 3')
print('start 4')
@ -204,7 +209,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["text"]])
return out
#Return: ["□ 1:00pm to 2:00pm", "Read a book"]