Skip to content

Commit

Permalink
Allow table content to support CJK text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
yetist committed Aug 15, 2023
1 parent 6fdb290 commit e80fc22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions archinstall/lib/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def as_table(
if capitalize:
key = key.capitalize()

key_list.append(key.ljust(width))
key_list.append(cjk_ljust(key, width))

output += ' | '.join(key_list) + '\n'
output += '-' * len(output) + '\n'
Expand All @@ -100,9 +100,9 @@ def as_table(
value = '*' * width

if isinstance(value, (int, float)) or (isinstance(value, str) and value.isnumeric()):
obj_data.append(str(value).rjust(width))
obj_data.append(cjk_rjust(str(value), width))
else:
obj_data.append(str(value).ljust(width))
obj_data.append(cjk_ljust(str(value), width))

output += ' | '.join(obj_data) + '\n'

Expand Down

0 comments on commit e80fc22

Please sign in to comment.