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

Felix Yan fyan at archlinux.org
Mon Feb 1 03:29:11 UTC 2016


    Date: Monday, February 1, 2016 @ 04:29:11
  Author: fyan
Revision: 159729

archrelease: copy trunk to community-testing-any

Added:
  python-colorama/repos/community-testing-any/
  python-colorama/repos/community-testing-any/PKGBUILD
    (from rev 159728, python-colorama/trunk/PKGBUILD)
  python-colorama/repos/community-testing-any/wrapped.patch
    (from rev 159728, python-colorama/trunk/wrapped.patch)

---------------+
 PKGBUILD      |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 wrapped.patch |   49 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)

Copied: python-colorama/repos/community-testing-any/PKGBUILD (from rev 159728, python-colorama/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD	                        (rev 0)
+++ community-testing-any/PKGBUILD	2016-02-01 03:29:11 UTC (rev 159729)
@@ -0,0 +1,60 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Alexander Duscheleit <jinks at archlinux.us>
+
+pkgbase=python-colorama
+pkgname=('python-colorama' 'python2-colorama')
+pkgver=0.3.6
+pkgrel=1
+pkgdesc="Python API for cross-platform colored terminal text."
+arch=('any')
+url="http://pypi.python.org/pypi/colorama"
+license=('BSD')
+makedepends=('python-setuptools' 'python2-setuptools' 'git')
+checkdepends=('python-mock' 'python2-mock')
+source=("git+https://github.com/tartley/colorama.git#tag=$pkgver"
+        wrapped.patch)
+md5sums=('SKIP'
+         '5845be5ce4ac50b5e74c4ca44424e669')
+
+prepare() {
+  # https://github.com/tartley/colorama/pull/84
+  (cd colorama; patch -p1 -i ../wrapped.patch)
+  cp -a colorama{,-py2}
+}
+
+build() {
+  cd "$srcdir/colorama"
+  python setup.py build
+
+  cd "$srcdir/colorama-py2"
+  python2 setup.py build
+}
+
+check() {
+  cd "$srcdir/colorama"
+  python -m unittest discover -p *_test.py || warning "Tests failed"
+
+  cd "$srcdir/colorama-py2"
+  python2 -m unittest discover -p *_test.py || warning "Tests failed"
+}
+
+package_python-colorama() {
+  depends=('python')
+
+  cd "$srcdir/colorama"
+  python setup.py install --root="$pkgdir" --optimize=1
+
+  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
+}
+
+package_python2-colorama() {
+  depends=('python2')
+
+  cd "$srcdir/colorama-py2"
+  python2 setup.py install --root="$pkgdir" --optimize=1
+
+  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
+}
+
+# vim:set ts=2 sw=2 et:

Copied: python-colorama/repos/community-testing-any/wrapped.patch (from rev 159728, python-colorama/trunk/wrapped.patch)
===================================================================
--- community-testing-any/wrapped.patch	                        (rev 0)
+++ community-testing-any/wrapped.patch	2016-02-01 03:29:11 UTC (rev 159729)
@@ -0,0 +1,49 @@
+From b29cb9231bacd87a16f947b945708bfac99b33a0 Mon Sep 17 00:00:00 2001
+From: Daniel Hahler <git at thequod.de>
+Date: Fri, 22 Jan 2016 22:54:52 +0100
+Subject: [PATCH] Check for 'closed' attribute on 'wrapped' in AnsiToWin32
+
+---
+ colorama/ansitowin32.py            | 8 ++++++--
+ colorama/tests/ansitowin32_test.py | 5 ++++-
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/colorama/ansitowin32.py b/colorama/ansitowin32.py
+index a750d2a..0698eba 100644
+--- a/colorama/ansitowin32.py
++++ b/colorama/ansitowin32.py
+@@ -64,12 +64,16 @@ def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
+ 
+         # should we strip ANSI sequences from our output?
+         if strip is None:
+-            strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
++            strip = conversion_supported or (
++                hasattr(wrapped, 'closed') and not wrapped.closed and not
++                is_a_tty(wrapped))
+         self.strip = strip
+ 
+         # should we should convert ANSI sequences into win32 calls?
+         if convert is None:
+-            convert = conversion_supported and not wrapped.closed and is_a_tty(wrapped)
++            convert = (conversion_supported and
++                       hasattr(wrapped, 'closed') and not
++                       wrapped.closed and is_a_tty(wrapped))
+         self.convert = convert
+ 
+         # dict of ansi codes to win32 functions and parameters
+diff --git a/colorama/tests/ansitowin32_test.py b/colorama/tests/ansitowin32_test.py
+index f351763..5ba96d0 100644
+--- a/colorama/tests/ansitowin32_test.py
++++ b/colorama/tests/ansitowin32_test.py
+@@ -166,7 +166,10 @@ def test_reset_all_shouldnt_raise_on_closed_orig_stdout(self):
+     def test_wrap_shouldnt_raise_on_closed_orig_stdout(self):
+         stream = StringIO()
+         stream.close()
+-        converter = AnsiToWin32(stream)
++        AnsiToWin32(stream)
++
++    def test_wrap_shouldnt_raise_on_missing_closed_attrib(self):
++        AnsiToWin32(object())
+ 
+     def testExtractParams(self):
+         stream = AnsiToWin32(Mock())



More information about the arch-commits mailing list