Skip to content

Commit a05a08c

Browse files
committed
remove without_header_hide rule (not necessary anymore)
1 parent 82e78a8 commit a05a08c

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tabulate.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@
4040
# with_header_hide (a list of strings) is a list of elements to be not
4141
# displayed if a table has column headers.
4242
#
43-
# without_header_hide (a list of strings) is a list of elements to be
44-
# not displayed if a table doesn't have column headers.
45-
#
46-
HidingRules = namedtuple("HidingRules", ["with_header_hide", "without_header_hide"])
43+
HidingRules = namedtuple("HidingRules", ["with_header_hide"])
4744

4845
# A table structure is suppposed to be:
4946
#
@@ -90,8 +87,7 @@
9087
headerrow=DataRow("", " ", ""),
9188
datarow=DataRow("", " ", ""),
9289
padding=0,
93-
hiding=HidingRules(with_header_hide=["lineabove", "linebelow"],
94-
without_header_hide=[])),
90+
hiding=HidingRules(with_header_hide=["lineabove", "linebelow"])),
9591
"plain":
9692
TableFormat(lineabove=None, linebelowheader=None,
9793
linebetweenrows=None, linebelow=None,
@@ -776,13 +772,7 @@ def _line_segment_with_colons(linefmt, align, colwidth):
776772
def _format_table(fmt, headers, rows, colwidths, colaligns):
777773
"""Produce a plain-text representation of the table."""
778774
lines = []
779-
if fmt.hiding:
780-
if headers:
781-
hidden = fmt.hiding.with_header_hide
782-
else:
783-
hidden = fmt.hiding.without_header_hide
784-
else:
785-
hidden = []
775+
hidden = fmt.hiding.with_header_hide if (fmt.hiding and headers) else []
786776
pad = fmt.padding
787777
headerrow = fmt.headerrow
788778

0 commit comments

Comments
 (0)