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
print(buf)
elif i.element == "t":
rendered = True
buf = [0] * len(i.data.data[0])
for j in i.data.data:
c = 0
@ -110,6 +111,19 @@ def renderer(chain):
cbuf = "| " + ' | '.join(j) + " |"
print(cbuf)
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()
chain = []