summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@gmail.com>2013-05-02 09:53:52 -0700
committerDoug Hellmann <doug.hellmann@gmail.com>2013-05-02 09:53:52 -0700
commit5f0ea40aabf14922d7daca205abe1d59f7220492 (patch)
tree717bf2a43e39eda53740aa4c7439163787a0868f
parentdf52cc387dbc446350af717ee5a6e83cba351d92 (diff)
parentd1be2d0081e33f6f7b5a533245b9d623e0285f99 (diff)
downloadcliff-5f0ea40aabf14922d7daca205abe1d59f7220492.tar.gz
Merge pull request #4 from dirkmueller/prettytable
Restore compatibility with Prettytable < 0.7.2
-rw-r--r--cliff/formatters/table.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cliff/formatters/table.py b/cliff/formatters/table.py
index 5b625ed..b13b364 100644
--- a/cliff/formatters/table.py
+++ b/cliff/formatters/table.py
@@ -22,7 +22,7 @@ class TableFormatter(ListFormatter, SingleFormatter):
pass
def emit_list(self, column_names, data, stdout, parsed_args):
- x = prettytable.PrettyTable(column_names)
+ x = prettytable.PrettyTable(column_names, print_empty=False)
x.padding_width = 1
# Figure out the types of the columns in the
# first row and set the alignment of the
@@ -46,7 +46,8 @@ class TableFormatter(ListFormatter, SingleFormatter):
return
def emit_one(self, column_names, data, stdout, parsed_args):
- x = prettytable.PrettyTable(field_names=('Field', 'Value'))
+ x = prettytable.PrettyTable(field_names=('Field', 'Value'),
+ print_empty=False)
x.padding_width = 1
# Align all columns left because the values are
# not all the same type.