(self, title, current, indent_level=0)
| 233 | pass |
| 234 | |
| 235 | def _build_table(self, title, current, indent_level=0): |
| 236 | if not current: |
| 237 | return False |
| 238 | if title is not None: |
| 239 | self.table.new_section(title, indent_level=indent_level) |
| 240 | if isinstance(current, list): |
| 241 | if isinstance(current[0], dict): |
| 242 | self._build_sub_table_from_list(current, indent_level, title) |
| 243 | else: |
| 244 | for item in current: |
| 245 | if self._scalar_type(item): |
| 246 | self.table.add_row([item]) |
| 247 | elif all(self._scalar_type(el) for el in item): |
| 248 | self.table.add_row(item) |
| 249 | else: |
| 250 | self._build_table(title=None, current=item) |
| 251 | if isinstance(current, dict): |
| 252 | # Render a single row section with keys as header |
| 253 | # and the row as the values, unless the value |
| 254 | # is a list. |
| 255 | self._build_sub_table_from_dict(current, indent_level) |
| 256 | return True |
| 257 | |
| 258 | def _build_sub_table_from_dict(self, current, indent_level): |
| 259 | # Render a single row section with keys as header |
no test coverage detected