add formatter command
This commit is contained in:
parent
af8842bb0b
commit
4f4897e0f2
4 changed files with 91 additions and 48 deletions
|
|
@ -23,8 +23,7 @@ formatters = ('htmltable', 'multiline', 'simple', 'table', 'webkit')
|
|||
|
||||
|
||||
def load_formatter(name):
|
||||
if name not in formatters:
|
||||
raise Exception(u'Formatter "%s" not found' % name)
|
||||
assert name in formatters
|
||||
if name in ('htmltable', 'table'):
|
||||
from .table import TableFormatter
|
||||
if name == 'htmltable':
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class TableFormatter(IFormatter):
|
|||
return s
|
||||
else:
|
||||
print s.encode('utf-8')
|
||||
self.queue = []
|
||||
|
||||
def format_dict(self, item):
|
||||
# format is done in self.flush() by prettytable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue