15
0
forked from pool/python-cliff

Accepting request 174287 from devel:languages:python

- add 0001-Restore-compatibility-with-Prettytable-0.7.2.patch (forwarded request 174280 from dirkmueller)

OBS-URL: https://build.opensuse.org/request/show/174287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cliff?expand=0&rev=8
This commit is contained in:
Stephan Kulow
2013-05-02 13:56:06 +00:00
committed by Git OBS Bridge
parent a9731ea0f1
commit f1ad881443
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
From d1be2d0081e33f6f7b5a533245b9d623e0285f99 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr>
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

View File

@@ -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

View File

@@ -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