fix incorrect boxify alignment and compile for macos

This commit is contained in:
W̷̛͒i̶̓͗l̷͗̌ľ̶͘ committed 2021-11-28 21:53:26 +00:00
1 parent e4bd9247cb
commit 12bca00f05
4 files changed
+3 -2

No files matched your search

Vendored
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -37,7 +37,7 @@ def boxify(text, length=0, align="left"):
processed = []
for i in range(len(textsplit)):
processed.append('║ ' + (" "*(length-len(textsplit[i]) if align == 'right' else math.floor((length-len(textsplit[i]))/2) if align == 'center' else 0)) +
textsplit[i] + (" "*(length-len(textsplit[i]) if align == 'right' else math.ceil((length-len(textsplit[i]))/2) if align == 'center' else 0)) + ' ║')
textsplit[i] + (" "*(length-len(textsplit[i]) if align == 'left' else math.ceil((length-len(textsplit[i]))/2) if align == 'center' else 0)) + ' ║')
return ('╔'+((length+2)*'═')+'╗\n'+("\n".join(processed))+'\n╚'+((length+2)*'═')+'╝')
Executable
BIN
View File
Binary file not shown.
+2 -1
View File
@@ -1 +1,2 @@
log(boxify('hello world\nhello worlddddd', 0, 'center'))
log(boxify('hello world\nhello worlddddd', 0, 'center'))
log(boxify('hello world\nhello worlddddd', 0, 'right'))