[arch-commits] Commit in python-terminaltables/repos (3 files)

Felix Yan felixonmars at archlinux.org
Thu Nov 12 19:21:28 UTC 2020


    Date: Thursday, November 12, 2020 @ 19:21:28
  Author: felixonmars
Revision: 753438

archrelease: copy trunk to community-staging-any

Added:
  python-terminaltables/repos/community-staging-any/
  python-terminaltables/repos/community-staging-any/PKGBUILD
    (from rev 753437, python-terminaltables/trunk/PKGBUILD)
  python-terminaltables/repos/community-staging-any/python-3.8.patch
    (from rev 753437, python-terminaltables/trunk/python-3.8.patch)

------------------+
 PKGBUILD         |   43 +++++++++++++++++++++++++++++++++++++++++++
 python-3.8.patch |   26 ++++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

Copied: python-terminaltables/repos/community-staging-any/PKGBUILD (from rev 753437, python-terminaltables/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2020-11-12 19:21:28 UTC (rev 753438)
@@ -0,0 +1,43 @@
+# Maintainer: Christian Rebischke <chris.rebischke[at]archlinux[dot]org>
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+
+pkgname=python-terminaltables
+_pyname=terminaltables
+pkgver=3.1.0
+pkgrel=8
+pkgdesc="Generate simple tables in terminals from a nested list of strings"
+arch=('any')
+url="https://github.com/Robpol86/terminaltables"
+license=('MIT')
+depends=('python')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest' 'python-colorama' 'python-termcolor' 'python-colorclass')
+source=("${_pyname}-${pkgver}.tar.gz::https://github.com/Robpol86/${_pyname}/archive/v${pkgver}.tar.gz"
+        python-3.8.patch)
+sha512sums=('dc49458652fff8bc6094d316d84c9b8e9fca1a26e3230c0b668bc03ec8528793f4ef024e8032d4a56fbfabfdfd4a1142870f550f0b373ba6a42dd2e3ead3f501'
+            '9a33ef51cbd2854bf9acc247e2d966332229446158e7dae9cad25e03335eb9689d50b0a22234285aa56c707e6e93c12f950299efcfbe7e42ed527216090592f2')
+
+prepare() {
+  cd ${_pyname}-${pkgver}
+  patch -Np1 < ../python-3.8.patch
+}
+
+build() {
+  cd ${_pyname}-${pkgver}
+  python setup.py build
+}
+
+check() {
+  cd ${_pyname}-${pkgver}
+  py.test
+}
+
+package() {
+  cd ${_pyname}-${pkgver}
+  python setup.py install -O1 --root="${pkgdir}" --skip-build
+  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 example*.py -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
+}
+
+# vim:set et sw=2 ts=2 tw=79:

Copied: python-terminaltables/repos/community-staging-any/python-3.8.patch (from rev 753437, python-terminaltables/trunk/python-3.8.patch)
===================================================================
--- community-staging-any/python-3.8.patch	                        (rev 0)
+++ community-staging-any/python-3.8.patch	2020-11-12 19:21:28 UTC (rev 753438)
@@ -0,0 +1,26 @@
+From dcd9ba5c1c35d986fabe1b3a529cf15d08875a33 Mon Sep 17 00:00:00 2001
+From: Carl Suster <carl at contraflo.ws>
+Date: Tue, 12 Nov 2019 14:19:23 +1100
+Subject: [PATCH] Write bytes to underluing buffer of stdout
+
+This was adapted from an example in the python docs and solves test failures seen on the CI. We need to write to the underlying buffer object of the stream, but in case `sys.stdout` was replaced with a file-like object without a buffer there's a fallback to direct writing.
+---
+ terminaltables/terminal_io.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/terminaltables/terminal_io.py b/terminaltables/terminal_io.py
+index 8b8c10d..005da1b 100644
+--- a/terminaltables/terminal_io.py
++++ b/terminaltables/terminal_io.py
+@@ -94,5 +94,10 @@ def set_terminal_title(title, kernel32=None):
+             return kernel32.SetConsoleTitleW(title) != 0
+ 
+     # Linux/OSX.
+-    sys.stdout.write(b'\033]0;' + title_bytes + b'\007')
++    set_title = b'\033]0;' + title_bytes + b'\007'
++    if hasattr(sys.stdout, 'buffer'):
++        sys.stdout.buffer.write(set_title)
++    else:
++        text = set_title.decode(sys.stdout.encoding, 'strict')
++        sys.stdout.write(text)
+     return True



More information about the arch-commits mailing list