Skip to content

Commit 64b42e2

Browse files
committed
Adjust format of table for accessibility
1 parent e0f7597 commit 64b42e2

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

awscli/customizations/configure/list.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,14 @@ class ConfigureListCommand(BasicCommand):
5151
)
5252

5353
def __init__(self, session, stream=None):
54-
super(ConfigureListCommand, self).__init__(session)
54+
super().__init__(session)
5555
if stream is None:
5656
stream = sys.stdout
5757
self._stream = stream
5858

5959
def _run_main(self, args, parsed_globals):
6060
self._display_config_value(
61-
ConfigValue('Value', 'Type', 'Location'), 'Name'
62-
)
63-
self._display_config_value(
64-
ConfigValue('-----', '----', '--------'), '----'
61+
ConfigValue('VALUE', 'TYPE', 'LOCATION'), 'NAME'
6562
)
6663

6764
if parsed_globals and parsed_globals.profile is not None:
@@ -80,13 +77,10 @@ def _run_main(self, args, parsed_globals):
8077

8178
def _display_config_value(self, config_value, config_name):
8279
self._stream.write(
83-
'%10s %24s %16s %s\n'
84-
% (
85-
config_name,
86-
config_value.value,
87-
config_value.config_type,
88-
config_value.config_variable,
89-
)
80+
f'{config_name:<10} : '
81+
f'{config_value.value:<24} : '
82+
f'{str(config_value.config_type):<16} : '
83+
f'{str(config_value.config_variable)}\n'
9084
)
9185

9286
def _lookup_credentials(self):

tests/functional/configure/test_configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_list_command(self):
5757
stdout, _, _ = self.run_cmd("configure list")
5858
self.assertRegex(stdout, r"access_key.+config-file")
5959
self.assertRegex(stdout, r"secret_key.+config-file")
60-
self.assertRegex(stdout, r"region\s+us-west-2\s+config-file")
60+
self.assertRegex(stdout, r"region\s+:\sus-west-2\s+:\sconfig-file")
6161

6262
def test_get_command(self):
6363
self.set_config_file_contents(

0 commit comments

Comments
 (0)