From d80ad16e82bb4a9a63ac86517bfb199c74841b21 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 07 2019 09:25:22 +0000 Subject: import python-urwid-1.3.1-4.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c42dd83 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/urwid-1.3.1.tar.gz diff --git a/.python-urwid.metadata b/.python-urwid.metadata new file mode 100644 index 0000000..fe24108 --- /dev/null +++ b/.python-urwid.metadata @@ -0,0 +1 @@ +5c562de41e150b87c8e2660f70c699fb6e951127 SOURCES/urwid-1.3.1.tar.gz diff --git a/SOURCES/python-urwid-test_event_loops.patch b/SOURCES/python-urwid-test_event_loops.patch new file mode 100644 index 0000000..2622a0e --- /dev/null +++ b/SOURCES/python-urwid-test_event_loops.patch @@ -0,0 +1,32 @@ +commit 4b0ed8b6030450e6d99909a7c683e9642e546387 +Author: Michael Hudson-Doyle +Date: Wed Jun 7 13:52:17 2017 -0700 + + fix test_remove_watch_file flakiness + + pass a known-good file descriptor to watch_file rather than hard-coding 5 + + Fixes #164 + +diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py +index c85bbed..b01212d 100644 +--- a/urwid/tests/test_event_loops.py ++++ b/urwid/tests/test_event_loops.py +@@ -30,9 +30,14 @@ class EventLoopTestMixin(object): + + def test_remove_watch_file(self): + evl = self.evl +- handle = evl.watch_file(5, lambda: None) +- self.assertTrue(evl.remove_watch_file(handle)) +- self.assertFalse(evl.remove_watch_file(handle)) ++ fd_r, fd_w = os.pipe() ++ try: ++ handle = evl.watch_file(fd_r, lambda: None) ++ self.assertTrue(evl.remove_watch_file(handle)) ++ self.assertFalse(evl.remove_watch_file(handle)) ++ finally: ++ os.close(fd_r) ++ os.close(fd_w) + + _expected_idle_handle = 1 + diff --git a/SOURCES/python-urwid-test_vterm-EINTR.patch b/SOURCES/python-urwid-test_vterm-EINTR.patch new file mode 100644 index 0000000..caec6db --- /dev/null +++ b/SOURCES/python-urwid-test_vterm-EINTR.patch @@ -0,0 +1,49 @@ +commit f68f2cf089cfd5ec45863baf59a91d5aeb0cf5c3 +Author: Mike Gilbert +Date: Sat Jun 3 14:53:51 2017 -0400 + + test_vterm: handle EINTR when reading from pipe + + Fixes: https://github.com/urwid/urwid/issues/230 + +diff --git a/urwid/tests/test_vterm.py b/urwid/tests/test_vterm.py +index 4dadfcc..075c653 100644 +--- a/urwid/tests/test_vterm.py ++++ b/urwid/tests/test_vterm.py +@@ -18,6 +18,7 @@ + # + # Urwid web site: http://excess.org/urwid/ + ++import errno + import os + import sys + import unittest +@@ -28,7 +29,6 @@ from urwid import vterm + from urwid import signals + from urwid.compat import B + +- + class DummyCommand(object): + QUITSTRING = B('|||quit|||') + +@@ -41,12 +41,20 @@ class DummyCommand(object): + stdout.write(B('\x1bc')) + + while True: +- data = os.read(self.reader, 1024) ++ data = self.read(1024) + if self.QUITSTRING == data: + break + stdout.write(data) + stdout.flush() + ++ def read(self, size): ++ while True: ++ try: ++ return os.read(self.reader, size) ++ except OSError as e: ++ if e.errno != errno.EINTR: ++ raise ++ + def write(self, data): + os.write(self.writer, data) diff --git a/SOURCES/python-urwid-test_vterm-NUL.patch b/SOURCES/python-urwid-test_vterm-NUL.patch new file mode 100644 index 0000000..ca184db --- /dev/null +++ b/SOURCES/python-urwid-test_vterm-NUL.patch @@ -0,0 +1,47 @@ +commit 701138a380fac06023e5915448af92ba13614cb9 +Author: aszlig +Date: Thu Feb 11 03:14:07 2016 +0100 + + vterm: Fix handling of NUL characters + + According to the VT100 programmers manual, the NUL character has to be + ignored (at least on our side, because we are not a printer): + + http://vt100.net/docs/tp83/appendixb.html + + According to the bug reporter the VMS console driver inserts NUL + characters after line feeds and our implementation prints those as "?". + + Tested against Python 2.7, 3.2, 3.3, 3.4 and 3.5. + + Signed-off-by: aszlig + Reported-by: Robert Urban + +diff --git a/urwid/tests/test_vterm.py b/urwid/tests/test_vterm.py +index 59fe166..4dadfcc 100644 +--- a/urwid/tests/test_vterm.py ++++ b/urwid/tests/test_vterm.py +@@ -143,6 +143,10 @@ class TermTest(unittest.TestCase): + self.write('1\n2\n3\n4\e[2;1f\e[2M') + self.expect('1\n4') + ++ def test_nul(self): ++ self.write('a\0b') ++ self.expect('ab') ++ + def test_movement(self): + self.write('\e[10;20H11\e[10;0f\e[20C\e[K') + self.expect('\n' * 9 + ' ' * 19 + '1') +diff --git a/urwid/vterm.py b/urwid/vterm.py +index cc4eb7f..0f091ea 100644 +--- a/urwid/vterm.py ++++ b/urwid/vterm.py +@@ -671,7 +671,7 @@ class TermCanvas(Canvas): + self.widget.beep() + elif not dc and char in B("\x18\x1a"): # CAN/SUB + self.leave_escape() +- elif not dc and char == B("\x7f"): # DEL ++ elif not dc and char in B("\x00\x7f"): # NUL/DEL + pass # this is ignored + elif self.within_escape: + self.parse_escape(char) diff --git a/SPECS/python-urwid.spec b/SPECS/python-urwid.spec new file mode 100644 index 0000000..99be529 --- /dev/null +++ b/SPECS/python-urwid.spec @@ -0,0 +1,179 @@ +Name: python-urwid +Version: 1.3.1 +Release: 4%{?dist} +Summary: Console user interface library + +License: LGPLv2+ +URL: http://excess.org/urwid/ +Source0: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.tar.gz + +# https://github.com/urwid/urwid/pull/237/commits/f68f2cf089cfd5ec45863baf59a91d5aeb0cf5c3 +Patch0: python-urwid-test_vterm-EINTR.patch + +# https://github.com/urwid/urwid/commit/701138a380fac06023e5915448af92ba13614cb9 +Patch1: python-urwid-test_vterm-NUL.patch + +# https://github.com/urwid/urwid/commit/4b0ed8b6030450e6d99909a7c683e9642e546387 +Patch2: python-urwid-test_event_loops.patch + +%global _description\ +Urwid is a Python library for making text console applications. It has\ +many features including fluid interface resizing, support for UTF-8 and\ +CJK encodings, standard and custom text layout modes, simple markup for\ +setting text attributes, and a powerful, dynamic list box that handles a\ +mix of widget types. It is flexible, modular, and leaves the developer in\ +control. + +%description %_description +%package -n python3-urwid +Summary: %summary +%{?python_provide:%python_provide python3-urwid} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-test +# needed by selftest suite for test.support +BuildRequires: %{_bindir}/2to3 + +%description -n python3-urwid %_description + +%prep +%setup -q -n urwid-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; +find urwid -type f -name "*.py" -exec chmod 644 {} \; + +%build +%py3_build + +find examples -type f -exec chmod 0644 \{\} \; + +%install +%py3_install + +%check +%{__python3} setup.py test + +%files -n python3-urwid +%license COPYING +%doc README.rst examples docs +%{python3_sitearch}/urwid +%{python3_sitearch}/urwid-%{version}*.egg-info + +%changelog +* Thu May 31 2018 Petr Viktorin - 1.3.1-4 +- Remove Python 2 subpackage + https://bugzilla.redhat.com/show_bug.cgi?id=1567166 + +* Fri Feb 09 2018 Fedora Release Engineering - 1.3.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Nov 15 2017 David Cantrell - 1.3.1-2 +- Apply upstream fix for EINTR handling in test_vterm test case +- Apply upstream fix for test_remove_watch_file flakiness +- Apply upstream fix for test_vterm handling of NUL characters + +* Sat Aug 19 2017 Petr Viktorin - 1.3.1-1 +- Update to upstream bugfix release 1.3.1 + See http://urwid.org/changelog.html#urwid-1-3-1 + +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 1.3.0-11 +- Python 2 binary package renamed to python2-urwid + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Thu Aug 03 2017 Fedora Release Engineering - 1.3.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.3.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.3.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 1.3.0-7 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 1.3.0-6 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 1.3.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Nov 10 2015 Fedora Release Engineering - 1.3.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Tue Nov 3 2015 Toshio Kuratomi - 1.3.0-3 +- Remove executable bit on docs so that they do not bring in extra rpm + dependencies. This complies with packaging guidelines and fixes the + problem of python3-urwid requiring the python2 package. + +* Thu Jun 18 2015 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Nov 25 2014 David Cantrell - 1.3.0-1 +- Upgrade to urwid-1.3.0 (#1150540) + +* Sun Aug 17 2014 Fedora Release Engineering - 1.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Jun 12 2014 David Cantrell - 1.2.1-1 +- Upgrade to urwid-1.2.1 (#1047698) + +* Sun Jun 08 2014 Fedora Release Engineering - 1.1.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 28 2014 Kalev Lember - 1.1.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Fri Dec 06 2013 Pierre-Yves Chibon fr - 1.1.1-3 +- Change BR from python-setuptools-devel to python-setuptools + See https://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel + +* Sun Aug 04 2013 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Nov 21 2012 Fabian Deutsch - 1.1.1 -1 +- Bugfix update + +* Tue Oct 23 2012 Fabian Deutsch - 1.1.0-2 +- Add new docs and examples dir + +* Tue Oct 23 2012 Fabian Deutsch - 1.1.0-1 +- Update to upstream 1.1.0 + +* Wed Sep 26 2012 Fabian Deutsch - 1.0.2-1 +- Update to upstream 1.0.2 + +* Mon Aug 27 2012 David Malcolm - 1.0.0-7 +- add missing BRs on python-test and python3-test (for test.support) + +* Fri Aug 24 2012 David Malcolm - 1.0.0-6 +- remove rhel logic from with_python3 conditional +- remove stray references to mako + +* Sat Aug 04 2012 David Malcolm - 1.0.0-5 +- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 + +* Sat Jul 21 2012 Fedora Release Engineering - 1.0.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 1.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Oct 24 2011 Luke Macken - 1.0.0-2 +- Add a python3-urwid subpackage (#746627) + +* Wed Oct 19 2011 Luke Macken - 1.0.0 +- Update to version 1.0.0 +- Add python-setuptools-devel to the BuildRequires +- Run the test suite using the setup.py + +* Wed Feb 09 2011 Fedora Release Engineering - 0.9.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jul 27 2010 David Malcolm - 0.9.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Wed May 19 2010 David Cantrell - 0.9.9.1-1 +- Initial package