MCPcopy Create free account
hub / github.com/aws/aws-cli / convert_to_vertical_table

Function convert_to_vertical_table

awscli/table.py:118–137  ·  view source on GitHub ↗
(sections)

Source from the content-addressed store, hash-verified

116
117
118def convert_to_vertical_table(sections):
119 # Any section that only has a single row is
120 # inverted, so:
121 # header1 | header2 | header3
122 # val1 | val2 | val2
123 #
124 # becomes:
125 #
126 # header1 | val1
127 # header2 | val2
128 # header3 | val3
129 for i, section in enumerate(sections):
130 if len(section.rows) == 1 and section.headers:
131 headers = section.headers
132 new_section = Section()
133 new_section.title = section.title
134 new_section.indent_level = section.indent_level
135 for header, element in zip(headers, section.rows[0]):
136 new_section.add_row([header, element])
137 sections[i] = new_section
138
139
140class IndentedStream:

Callers 2

renderMethod · 0.85

Calls 2

add_rowMethod · 0.95
SectionClass · 0.85

Tested by 1