summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch30
-rw-r--r--PKGBUILD37
3 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..44d3b0b352c1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+# Generated by mksrcinfo v8
+# Fri Feb 14 14:09:12 UTC 2020
+pkgbase = python2-prettytable
+ pkgdesc = A simple Python library for easily displaying tabular data
+ pkgver = 0.7.2
+ pkgrel = 12
+ url = https://pypi.python.org/pypi/PrettyTable
+ arch = any
+ license = BSD
+ makedepends = python2-setuptools
+ depends = python2
+ source = https://files.pythonhosted.org/packages/source/P/PrettyTable/prettytable-0.7.2.tar.gz
+ source = 0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
+ sha256sums = 2d5460dc9db74a32bcc8f9f67de68b2c4f4d2f01fa3bd518764c69156d9cacd9
+ sha256sums = 24e5f10a874910bdc5eab6807443a7f9712ac568fa5e940a313ac5b2a05150f8
+
+pkgname = python2-prettytable
+
diff --git a/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch b/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
new file mode 100644
index 000000000000..aca12255182b
--- /dev/null
+++ b/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
@@ -0,0 +1,30 @@
+From 9e291735c8e89879451c2feebda8f851dfa6e32c Mon Sep 17 00:00:00 2001
+From: Daniel Albers <daniel@lbe.rs>
+Date: Tue, 9 Dec 2014 17:47:50 +0100
+Subject: [PATCH] Fix column spacing with xterm reset escape sequence
+
+Change _re to also match \E(B\E[m as defined by terminfo for xterm:
+
+$ TERM=xterm tput sgr0 | od -xa
+0000000 281b 1b42 6d5b
+ esc ( B esc [ m
+---
+ prettytable.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/prettytable.py b/prettytable.py
+index a619659..3f6fb99 100644
+--- a/prettytable.py
++++ b/prettytable.py
+@@ -73,7 +73,7 @@ MSWORD_FRIENDLY = 11
+ PLAIN_COLUMNS = 12
+ RANDOM = 20
+
+-_re = re.compile("\033\[[0-9;]*m")
++_re = re.compile("\033(\[[0-9;]*m|\(B)")
+
+ def _get_size(text):
+ lines = text.split("\n")
+--
+2.2.0.rc0.207.ga3a616c
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3f28c5402c5f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Thore Bödecker <me [at] foxxx0 [dot] de>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Sebastien Leduc <sebastien@sleduc.fr>
+# Contributor: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
+
+_pkgname=prettytable
+pkgname=python2-prettytable
+pkgver=0.7.2
+pkgrel=12
+pkgdesc="A simple Python library for easily displaying tabular data"
+url="https://pypi.python.org/pypi/PrettyTable"
+arch=('any')
+license=('BSD')
+depends=(python2)
+makedepends=(python2-setuptools)
+source=("https://files.pythonhosted.org/packages/source/P/PrettyTable/prettytable-${pkgver}.tar.gz"
+ '0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch')
+sha256sums=('2d5460dc9db74a32bcc8f9f67de68b2c4f4d2f01fa3bd518764c69156d9cacd9'
+ '24e5f10a874910bdc5eab6807443a7f9712ac568fa5e940a313ac5b2a05150f8')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ patch -p1 -N -i "$srcdir"/0001-Fix-column-spacing-with-xterm-reset-escape-sequence.patch
+ # set interpreter to py2
+ sed -i 's|^#!/usr/bin/env python$|#!/usr/bin/env python2|1' *.py
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ python2 setup.py build
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ chmod 644 -R "${_pkgname}.egg-info"
+ python2 setup.py install --root="${pkgdir}/" --optimize=1
+}