MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / create_formatter

Function create_formatter

Solutions/3_5/tableformat.py:44–53  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

42 print('</tr>')
43
44def create_formatter(name):
45 if name == 'text':
46 formatter_cls = TextTableFormatter
47 elif name == 'csv':
48 formatter_cls = CSVTableFormatter
49 elif name == 'html':
50 formatter_cls = HTMLTableFormatter
51 else:
52 raise RuntimeError('Unknown format %s' % name)
53 return formatter_cls()
54
55
56

Callers 1

stock.pyFile · 0.90

Calls 1

formatter_clsClass · 0.50

Tested by

no test coverage detected