MCPcopy Create free account
hub / github.com/TabViewer/tabview / _get_column_widths

Method _get_column_widths

tabview/tabview.py:918–935  ·  view source on GitHub ↗

Compute column width array Args: width - 'max', 'mode', or an integer value Returns: [len of col 1, len of col 2, ....]

(self, width)

Source from the content-addressed store, hash-verified

916 return self.strpad(s, width)
917
918 def _get_column_widths(self, width):
919 """Compute column width array
920
921 Args: width - 'max', 'mode', or an integer value
922 Returns: [len of col 1, len of col 2, ....]
923
924 """
925 if width == 'max':
926 self.column_width = self._get_column_widths_max(self.data)
927 elif width == 'mode':
928 self.column_width = self._get_column_widths_mode(self.data)
929 else:
930 try:
931 width = int(width)
932 except (TypeError, ValueError):
933 width = 25
934 self.column_width = [width for i in
935 range(0, self.num_data_columns)]
936
937 @staticmethod
938 def __cell_len_dw(s):

Callers 2

_init_column_widthsMethod · 0.95
toggle_column_widthMethod · 0.95

Calls 2

Tested by

no test coverage detected