diff --git a/0001-Restore-compatibility-with-Prettytable-0.7.2.patch b/0001-Restore-compatibility-with-Prettytable-0.7.2.patch new file mode 100644 index 0000000..3e21643 --- /dev/null +++ b/0001-Restore-compatibility-with-Prettytable-0.7.2.patch @@ -0,0 +1,39 @@ +From d1be2d0081e33f6f7b5a533245b9d623e0285f99 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Thu, 2 May 2013 12:39:20 +0200 +Subject: [PATCH] Restore compatibility with Prettytable < 0.7.2 + +Starting with 0.7.2, PrettyTable changed default on how empty +tables are rendered. Before they were completely ommitted, now +the default is to show the table headers and decoration, just +no content. Restore the previous behavior to stay compatible. +--- + cliff/formatters/table.py | 5 +++-- + 1 file 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. +-- +1.8.1.4 + diff --git a/python-cliff.changes b/python-cliff.changes index 989ba5e..99bbf2c 100644 --- a/python-cliff.changes +++ b/python-cliff.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 2 10:42:04 UTC 2013 - dmueller@suse.com + +- add 0001-Restore-compatibility-with-Prettytable-0.7.2.patch + ------------------------------------------------------------------- Tue Apr 30 08:39:29 UTC 2013 - dmueller@suse.com diff --git a/python-cliff.spec b/python-cliff.spec index 808e023..7aa8e2d 100644 --- a/python-cliff.spec +++ b/python-cliff.spec @@ -25,6 +25,7 @@ License: Apache-2.0 Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/c/cliff/cliff-%{version}.tar.gz Patch0: ignore-cmd2-requires.diff +Patch1: 0001-Restore-compatibility-with-Prettytable-0.7.2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-argparse BuildRequires: python-devel @@ -66,6 +67,7 @@ This package contains documentation files for %{name}. %prep %setup -q -n cliff-%{version} %patch0 +%patch1 -p1 %build python setup.py build