diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a4c060..696569a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.4.0] - Unreleased + +### Added + +- box.ASCII_DOUBLE_HEAD + ## [3.3.0] - 2020-07-12 ### Added diff --git a/rich/box.py b/rich/box.py index a4cf672d..f21e3b58 100644 --- a/rich/box.py +++ b/rich/box.py @@ -174,6 +174,19 @@ ASCII2: Box = Box( """ ) +ASCII_DOUBLE_HEAD: Box = Box( + """\ ++-++ +| || ++=++ +| || ++-++ ++-++ +| || ++-++ +""" +) + SQUARE: Box = Box( """\ ┌─┬┐ @@ -412,6 +425,7 @@ if __name__ == "__main__": # pragma: no cover BOXES = [ "ASCII", "ASCII2", + "ASCII_DOUBLE_HEAD", "SQUARE", "MINIMAL", "MINIMAL_HEAVY_HEAD", diff --git a/rich/table.py b/rich/table.py index afe3b6de..f951e2f2 100644 --- a/rich/table.py +++ b/rich/table.py @@ -294,7 +294,7 @@ class Table(JupyterMixin): style (Union[str, Style], optional): Style for the column cells. Defaults to "none". justify (JustifyMethod, optional): Alignment for cells. Defaults to "left". width (int, optional): A minimum width in characters. Defaults to None. - ratio (int, optional): Flexible ratio for the column. Defaults to None. + ratio (int, optional): Flexible ratio for the column (requires ``Table.expand`` or ``Table.width``). Defaults to None. no_wrap (bool, optional): Set to ``True`` to disable wrapping of this column. """ @@ -652,13 +652,13 @@ class Table(JupyterMixin): cells.append(lines) cells[:] = [ - Segment.set_shape(_cell, width, max_height, style=table_style) + _Segment.set_shape(_cell, width, max_height, style=table_style) for width, _cell in zip(widths, cells) ] if _box: if last and show_footer: - yield Segment( + yield _Segment( _box.get_row(widths, "foot", edge=show_edge), border_style ) yield new_line