@@ -604,15 +604,15 @@ def generate_table(rows: Iterable[Union[Iterable, object]],
604604 columns : Collection [Union [str , Tuple [str , dict ]]]= None ,
605605 grid_style : Optional [Grid ]= None ,
606606 transpose : bool = False ,
607- row_decorator : Callable = None ) -> str :
607+ row_tagger : Callable = None ) -> str :
608608 """
609609 Convenience function to easily generate a table from rows/columns
610610
611611 :param rows: iterable of objects or iterable fields
612612 :param columns: Iterable of column definitions
613613 :param grid_style: The grid style to use
614614 :param transpose: Transpose the rows/columns for display
615- :param row_decorator : decorator function to apply per-row options
615+ :param row_tagger : decorator function to apply per-row options
616616 :return: formatted string containing the table
617617 """
618618 show_headers = True
@@ -646,7 +646,7 @@ def generate_table(rows: Iterable[Union[Iterable, object]],
646646 if grid_style is None :
647647 grid_style = DEFAULT_GRID
648648 formatter = TableFormatter (columns , grid_style = grid_style , show_header = show_headers ,
649- use_attribs = use_attrib , transpose = transpose , row_decorator = row_decorator )
649+ use_attribs = use_attrib , transpose = transpose , row_tagger = row_tagger )
650650 return formatter .generate_table (rows )
651651
652652
@@ -763,7 +763,7 @@ def __init__(self,
763763 use_attribs = False ,
764764 transpose = False ,
765765 row_show_header = False ,
766- row_decorator : Callable = None ):
766+ row_tagger : Callable = None ):
767767 """
768768 :param columns: list of either column names or tuples of (column name, dict of column options)
769769 :param cell_padding: number of spaces to pad to the left/right of each column
@@ -789,7 +789,7 @@ def __init__(self,
789789 TableFormatter .TABLE_OPT_TRANSPOSE : transpose ,
790790 TableFormatter .TABLE_OPT_ROW_HEADER : row_show_header }
791791 self ._show_header = show_header
792- self ._row_decorator = row_decorator
792+ self ._row_tagger = row_tagger
793793
794794 for col_index , column in enumerate (columns ):
795795 if isinstance (column , tuple ) and len (column ) > 1 and isinstance (column [1 ], dict ):
@@ -925,12 +925,12 @@ def generate_table(self, entries: Iterable[Union[Iterable, object]], force_trans
925925 except TypeError :
926926 # not iterable, so we just use the object directly
927927 entry_obj = entry
928- if self ._row_decorator is not None :
929- entry_opts = self ._row_decorator (entry_obj )
928+ if self ._row_tagger is not None :
929+ entry_opts = self ._row_tagger (entry_obj )
930930 else :
931931 entry_obj = entry [0 ]
932- if self ._row_decorator is not None :
933- entry_opts = self ._row_decorator (entry_obj )
932+ if self ._row_tagger is not None :
933+ entry_opts = self ._row_tagger (entry_obj )
934934 if len (entry ) == 2 and isinstance (entry [1 ], dict ):
935935 entry_opts .update (entry [1 ])
936936
@@ -966,8 +966,8 @@ def generate_table(self, entries: Iterable[Union[Iterable, object]], force_trans
966966 row .append (field_lines )
967967
968968 else :
969- if self ._row_decorator is not None :
970- entry_opts = self ._row_decorator (entry )
969+ if self ._row_tagger is not None :
970+ entry_opts = self ._row_tagger (entry )
971971 if len (entry ) == len (self ._columns ) + 1 and isinstance (entry [len (self ._columns )], dict ):
972972 # if there is exactly 1 more entry than columns, the last one is metadata
973973 entry_opts .update (entry [len (self ._columns )])
0 commit comments