rpms/bpython/F-12 bpython-0.9.6.2-suspend.patch, NONE, 1.1 bpython.spec, 1.12, 1.13
terjeros
terjeros at fedoraproject.org
Sun May 30 12:41:39 UTC 2010
Author: terjeros
Update of /cvs/pkgs/rpms/bpython/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv2901
Modified Files:
bpython.spec
Added Files:
bpython-0.9.6.2-suspend.patch
Log Message:
* Sun May 30 2010 Terje Rosten <terje.rosten at ntnu.no> - 0.9.6.2-5
- Add patch to fix suspend
bpython-0.9.6.2-suspend.patch:
cli.py | 11 +++++++++++
config.py | 2 ++
2 files changed, 13 insertions(+)
--- NEW FILE bpython-0.9.6.2-suspend.patch ---
diff -uNr -x '*.orig' bpython-0.9.6.2.orig/bpython/cli.py bpython-0.9.6.2/bpython/cli.py
--- bpython-0.9.6.2.orig/bpython/cli.py 2009-12-30 23:46:53.000000000 +0100
+++ bpython-0.9.6.2/bpython/cli.py 2010-05-30 14:23:25.000000000 +0200
@@ -832,6 +832,10 @@
elif key == 'KEY_BTAB':
return self.tab(back=True)
+ elif key in key_dispatch[config.suspend_key]:
+ self.suspend()
+ return ''
+
elif len(key) == 1 and not unicodedata.category(key) == 'Cc':
self.addstr(key)
self.print_line(self.s)
@@ -1215,6 +1219,10 @@
self.print_line(self.s, clr=True)
+ def suspend(self):
+ """ Suspend the current process for shell job control """
+ os.kill(os.getpid(), signal.SIGSTOP)
+
class Statusbar(object):
"""This class provides the status bar at the bottom of the screen.
It has message() and prompt() methods for user interactivity, as
@@ -1520,6 +1528,9 @@
old_sigwinch_handler = signal.signal(signal.SIGWINCH,
lambda *_: sigwinch(scr))
+ # redraw window after being suspended
+ signal.signal(signal.SIGCONT, lambda *_: sigwinch(scr))
+
stdscr = scr
try:
curses.start_color()
diff -uNr -x '*.orig' bpython-0.9.6.2.orig/bpython/config.py bpython-0.9.6.2/bpython/config.py
--- bpython-0.9.6.2.orig/bpython/config.py 2009-12-30 13:07:06.000000000 +0100
+++ bpython-0.9.6.2/bpython/config.py 2010-05-30 14:23:25.000000000 +0200
@@ -59,6 +59,7 @@
'pastebin': 'F8',
'save': 'C-s',
'show_source': 'F2',
+ 'suspend': 'C-z',
'undo': 'C-r',
'up_one_line': 'C-p',
'yank_from_buffer': 'C-y'}})
@@ -79,6 +80,7 @@
struct.pastebin_key = config.get('keyboard', 'pastebin')
struct.save_key = config.get('keyboard', 'save')
struct.show_source_key = config.get('keyboard', 'show_source')
+ struct.suspend_key = config.get('keyboard', 'suspend')
struct.undo_key = config.get('keyboard', 'undo')
struct.up_one_line_key = config.get('keyboard', 'up_one_line')
struct.down_one_line_key = config.get('keyboard', 'down_one_line')
Index: bpython.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bpython/F-12/bpython.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- bpython.spec 9 Apr 2010 20:27:10 -0000 1.12
+++ bpython.spec 30 May 2010 12:41:39 -0000 1.13
@@ -1,18 +1,27 @@
+%global with_python3 0
+
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: bpython
Summary: Fancy curses interface to the Python interactive interpreter
Version: 0.9.6.2
-Release: 2%{?dist}
+Release: 5%{?dist}
URL: http://www.bpython-interpreter.org/
Group: Development/Libraries
License: MIT
Source0: http://www.bpython-interpreter.org/releases/bpython-%{version}.tar.gz
+# http://bitbucket.org/bobf/bpython/issue/106/cant-suspend-ctrl-z-bpython
+Patch0: bpython-0.9.6.2-suspend.patch
BuildArch: noarch
BuildRequires: python-devel python-setuptools desktop-file-utils
-Requires: python-pygments pyparsing
+Requires: python-pygments
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%endif # if with_python3
+
%description
bpython is a fancy interface to the Python interpreter for Unix-like
operating systems. It has the following features:
@@ -26,17 +35,66 @@ operating systems. It has the following
o save the code you've entered to a file
o auto indentation
+%if 0%{?with_python3}
+%package -n python3-bpython
+Summary: Fancy curses interface to the Python 3 interactive interpreter
+Group: Development/Languages
+Requires: python3-pygments
+
+%description -n python3-bpython
+bpython is a fancy interface to the Python interpreter for Unix-like
+operating systems. It has the following features:
+ o in-line syntax highlighting
+ o readline-like autocomplete with suggestions displayed as you type
+ o expected parameter list for any Python function.
+ o eewind function to pop the last line of code from memory and
+ re-evaluate.
+ o send the code you've entered off to a pastebin and display the
+ pastebin URL for copying, etc.
+ o save the code you've entered to a file
+ o auto indentation
+
+This is the Python 3 build of bpython
+%endif # if with_python3
+
%prep
%setup -q
+%patch0 -p1
%{__sed} -i -e \
"s|/usr/share/docs/bpython/examples on Debian|%{_docdir}/%{name}-%{version}/sample-config on Fedora/RHEL|g" doc/bpython.1
%{__sed} -i -e '1d' bpython/{cli,keys}.py
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+# 2to3 is done for us by the setup.py
+%endif # with_python3
+
+
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
%install
%{__rm} -rf %{buildroot}
+
+# Install python 3 first, so that python 2 gets precedence:
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+# Give python 3 executables a "python3-" prefix to avoid collisions with their
+# python 2 counterparts:
+mv %{buildroot}/%{_bindir}/%{name} %{buildroot}/%{_bindir}/python3-%{name}
+%{__rm} -f %{buildroot}%{_datadir}/applications/%{name}.desktop
+%{__rm} -f %{buildroot}%{_bindir}/bpython-gtk
+popd
+%endif # with_python3
+
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%{__rm} -f %{buildroot}%{_datadir}/applications/%{name}.desktop
@@ -56,10 +114,26 @@ operating systems. It has the following
%{_bindir}/%{name}
%{python_sitelib}/%{name}*
%{_mandir}/man1/%{name}.1*
-%{_mandir}/man5/bpython-config.5*
+%{_mandir}/man5/%{name}-config.5*
#{_datadir}/applications/%{name}.desktop
+%if 0%{?with_python3}
+%files -n python3-bpython
+%defattr(-, root, root, -)
+%{_bindir}/python3-%{name}
+%{python3_sitelib}/%{name}*
+%endif # with_python3
+
%changelog
+* Sun May 30 2010 Terje Rosten <terje.rosten at ntnu.no> - 0.9.6.2-5
+- Add patch to fix suspend
+
+* Sun May 09 2010 Terje Rosten <terje.rosten at ntnu.no> - 0.9.6.2-4
+- bpython don't use pyparsing
+
+* Fri May 07 2010 David Malcolm <dmalcolm at redhat.com> - 0.9.6.2-3
+- Add python3 subpackage (bz #590107)
+
* Sat Apr 09 2010 Terje Rosten <terje.rosten at ntnu.no> - 0.9.6.2-2
- Fix man page (bz #561800)
More information about the scm-commits
mailing list