Compute column width array Args: width - 'max', 'mode', or an integer value Returns: [len of col 1, len of col 2, ....]
(self, width)
| 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): |
no test coverage detected