diff options
Diffstat (limited to 'cli_helpers')
-rw-r--r-- | cli_helpers/__init__.py | 2 | ||||
-rw-r--r-- | cli_helpers/tabular_output/tabulate_adapter.py | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/cli_helpers/__init__.py b/cli_helpers/__init__.py index b19ee4b..55e4709 100644 --- a/cli_helpers/__init__.py +++ b/cli_helpers/__init__.py @@ -1 +1 @@ -__version__ = "2.2.1" +__version__ = "2.3.0" diff --git a/cli_helpers/tabular_output/tabulate_adapter.py b/cli_helpers/tabular_output/tabulate_adapter.py index a7eabc0..2c557f8 100644 --- a/cli_helpers/tabular_output/tabulate_adapter.py +++ b/cli_helpers/tabular_output/tabulate_adapter.py @@ -52,9 +52,25 @@ tabulate._table_formats["ascii"] = tabulate.TableFormat( with_header_hide=None, ) +tabulate._table_formats["ascii_escaped"] = tabulate.TableFormat( + lineabove=tabulate.Line("+", "-", "+", "+"), + linebelowheader=tabulate.Line("+", "-", "+", "+"), + linebetweenrows=None, + linebelow=tabulate.Line("+", "-", "+", "+"), + headerrow=tabulate.DataRow("|", "|", "|"), + datarow=tabulate.DataRow("|", "|", "|"), + padding=1, + with_header_hide=None, +) + # "minimal" is the same as "plain", but without headers tabulate._table_formats["minimal"] = tabulate._table_formats["plain"] +tabulate.multiline_formats["psql_unicode"] = "psql_unicode" +tabulate.multiline_formats["double"] = "double" +tabulate.multiline_formats["ascii"] = "ascii" +tabulate.multiline_formats["minimal"] = "minimal" + supported_markup_formats = ( "mediawiki", "html", @@ -66,6 +82,7 @@ supported_markup_formats = ( ) supported_table_formats = ( "ascii", + "ascii_escaped", "plain", "simple", "minimal", @@ -82,7 +99,10 @@ supported_table_formats = ( supported_formats = supported_markup_formats + supported_table_formats -default_kwargs = {"ascii": {"numalign": "left"}} +default_kwargs = { + "ascii": {"numalign": "left"}, + "ascii_escaped": {"numalign": "left"}, +} headless_formats = ("minimal",) |