add support for lists

This commit is contained in:
randomuser 2021-06-30 13:47:34 -05:00
parent 922192ebfe
commit a071793d3c
1 changed files with 14 additions and 0 deletions

14
uml.py
View File

@ -88,6 +88,7 @@ def renderer(chain):
buf += i buf += i
print(buf) print(buf)
elif i.element == "t": elif i.element == "t":
rendered = True
buf = [0] * len(i.data.data[0]) buf = [0] * len(i.data.data[0])
for j in i.data.data: for j in i.data.data:
c = 0 c = 0
@ -110,6 +111,19 @@ def renderer(chain):
cbuf = "| " + ' | '.join(j) + " |" cbuf = "| " + ' | '.join(j) + " |"
print(cbuf) print(cbuf)
print("+" + "-" * width + "+") print("+" + "-" * width + "+")
elif i.element == "l":
rendered = True
buf = i.data.split(' ')
cbuf = "* "
for i in buf:
if (len(cbuf) + len(i) + 1) <= 63:
if not len(cbuf) == 2: cbuf += " "
cbuf += i
else:
print(cbuf)
cbuf = " "
cbuf += i
print(cbuf)
if rendered: print() if rendered: print()
chain = [] chain = []