From e80fc227cb5541832a8f1f9489bdef4ebbed1c87 Mon Sep 17 00:00:00 2001 From: Xiaotian Wu Date: Tue, 15 Aug 2023 11:50:58 +0800 Subject: [PATCH] Allow table content to support CJK text alignment --- archinstall/lib/output.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py index 0ecdc71b39..d9a4e11ff1 100644 --- a/archinstall/lib/output.py +++ b/archinstall/lib/output.py @@ -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' @@ -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'