MCPcopy Index your code
hub / github.com/aws/aws-sam-cli / write_text_rows

Method write_text_rows

samcli/cli/formatters.py:75–95  ·  view source on GitHub ↗

Write single-column text rows without two-column layout constraints. This is useful for "examples" or other content that should appear as simple indented text without the padding and wrapping behavior of write_dl. Parameters ---------- rows : Sequence[RowDef

(
        self,
        rows: Sequence[RowDefinition],
    )

Source from the content-addressed store, hash-verified

73 super().write_dl(modified_rows, col_max=col_max, col_spacing=col_spacing)
74
75 def write_text_rows(
76 self,
77 rows: Sequence[RowDefinition],
78 ) -> None:
79 """Write single-column text rows without two-column layout constraints.
80
81 This is useful for "examples" or other content that should appear as simple
82 indented text without the padding and wrapping behavior of write_dl.
83
84 Parameters
85 ----------
86 rows : Sequence[RowDefinition]
87 Rows to write. Only the 'name' field and 'extra_row_modifiers' are used.
88 """
89 for row in rows:
90 extra_row_modifiers = row.extra_row_modifiers or []
91 modified_row = row
92 for row_modifier in self.modifiers + extra_row_modifiers:
93 modified_row = row_modifier.apply(row=modified_row, justification_length=self.left_justification_length)
94 # Write the content with current indentation, no padding
95 self.write(f"{'':>{self.current_indent}}{modified_row.name.rstrip()}\n")
96
97 @contextmanager
98 def section(self, name: str) -> Iterator[None]:

Callers 15

format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45
format_examplesMethod · 0.45

Calls 2

applyMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected