(
self, console: "Console", options: "ConsoleOptions", widths: List[int]
)
| 753 | return measurement |
| 754 | |
| 755 | def _render( |
| 756 | self, console: "Console", options: "ConsoleOptions", widths: List[int] |
| 757 | ) -> "RenderResult": |
| 758 | table_style = console.get_style(self.style or "") |
| 759 | |
| 760 | border_style = table_style + console.get_style(self.border_style or "") |
| 761 | _column_cells = ( |
| 762 | self._get_cells(console, column_index, column) |
| 763 | for column_index, column in enumerate(self.columns) |
| 764 | ) |
| 765 | |
| 766 | row_cells: List[Tuple[_Cell, ...]] = list(zip(*_column_cells)) |
| 767 | _box = ( |
| 768 | self.box.substitute( |
| 769 | options, safe=pick_bool(self.safe_box, console.safe_box) |
| 770 | ) |
| 771 | if self.box |
| 772 | else None |
| 773 | ) |
| 774 | _box = _box.get_plain_headed_box() if _box and not self.show_header else _box |
| 775 | |
| 776 | new_line = Segment.line() |
| 777 | |
| 778 | columns = self.columns |
| 779 | show_header = self.show_header |
| 780 | show_footer = self.show_footer |
| 781 | show_edge = self.show_edge |
| 782 | show_lines = self.show_lines |
| 783 | leading = self.leading |
| 784 | |
| 785 | _Segment = Segment |
| 786 | if _box: |
| 787 | box_segments = [ |
| 788 | ( |
| 789 | _Segment(_box.head_left, border_style), |
| 790 | _Segment(_box.head_right, border_style), |
| 791 | _Segment(_box.head_vertical, border_style), |
| 792 | ), |
| 793 | ( |
| 794 | _Segment(_box.mid_left, border_style), |
| 795 | _Segment(_box.mid_right, border_style), |
| 796 | _Segment(_box.mid_vertical, border_style), |
| 797 | ), |
| 798 | ( |
| 799 | _Segment(_box.foot_left, border_style), |
| 800 | _Segment(_box.foot_right, border_style), |
| 801 | _Segment(_box.foot_vertical, border_style), |
| 802 | ), |
| 803 | ] |
| 804 | if show_edge: |
| 805 | yield _Segment(_box.get_top(widths), border_style) |
| 806 | yield new_line |
| 807 | else: |
| 808 | box_segments = [] |
| 809 | |
| 810 | get_row_style = self.get_row_style |
| 811 | get_style = console.get_style |
| 812 |
no test coverage detected