Create an appropriate formatter given an output format name
(name)
| 58 | pass |
| 59 | |
| 60 | def create_formatter(name): |
| 61 | ''' |
| 62 | Create an appropriate formatter given an output format name |
| 63 | ''' |
| 64 | if name == 'txt': |
| 65 | return TextTableFormatter() |
| 66 | elif name == 'csv': |
| 67 | return CSVTableFormatter() |
| 68 | elif name == 'html': |
| 69 | return HTMLTableFormatter() |
| 70 | else: |
| 71 | raise FormatError(f'Unknown table format {name}') |
| 72 | |
| 73 | def print_table(objects, columns, formatter): |
| 74 | ''' |
nothing calls this directly
no test coverage detected