Display a list of single-line strings as a compact set of columns. Override of cmd's columnize() that uses the render_columns() method. The method correctly handles strings with ANSI style sequences and full-width characters (like those used in CJK languages). :para
(self, str_list: Sequence[str] | None, display_width: int = 80)
| 4481 | return "\n".join(rows) |
| 4482 | |
| 4483 | def columnize(self, str_list: Sequence[str] | None, display_width: int = 80) -> None: |
| 4484 | """Display a list of single-line strings as a compact set of columns. |
| 4485 | |
| 4486 | Override of cmd's columnize() that uses the render_columns() method. |
| 4487 | The method correctly handles strings with ANSI style sequences and |
| 4488 | full-width characters (like those used in CJK languages). |
| 4489 | |
| 4490 | :param str_list: Sequence of single-line strings to display |
| 4491 | :param display_width: max number of display columns to fit into |
| 4492 | """ |
| 4493 | columnized_strs = self.render_columns(str_list, display_width) |
| 4494 | self.poutput(columnized_strs) |
| 4495 | |
| 4496 | @staticmethod |
| 4497 | def _build_shortcuts_parser() -> Cmd2ArgumentParser: |