diff options
author | Justin Lecher <jlec@gentoo.org> | 2010-02-20 12:21:39 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2010-02-20 12:21:39 +0000 |
commit | 0c563b1109c26fc352798ac9d56cfabc0c988d1f (patch) | |
tree | dad5b2398ed9e5e2f42236bb23cb106aebfa0057 /dev-python/pmw | |
parent | ProMol plugin for pymol, grep from #209970 (diff) | |
download | gentoo-2-0c563b1109c26fc352798ac9d56cfabc0c988d1f.tar.gz gentoo-2-0c563b1109c26fc352798ac9d56cfabc0c988d1f.tar.bz2 gentoo-2-0c563b1109c26fc352798ac9d56cfabc0c988d1f.zip |
Make deletecommand work with python 2.5, patched grabbed from debian
(Portage version: 2.2_rc63/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/pmw')
-rw-r--r-- | dev-python/pmw/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/pmw/files/1.3.2-python2.5.patch | 54 | ||||
-rw-r--r-- | dev-python/pmw/pmw-1.3.2-r2.ebuild | 53 |
3 files changed, 114 insertions, 1 deletions
diff --git a/dev-python/pmw/ChangeLog b/dev-python/pmw/ChangeLog index f73222e6f959..3916e965ca4e 100644 --- a/dev-python/pmw/ChangeLog +++ b/dev-python/pmw/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/pmw # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pmw/ChangeLog,v 1.26 2010/02/07 20:35:03 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pmw/ChangeLog,v 1.27 2010/02/20 12:21:38 jlec Exp $ + +*pmw-1.3.2-r2 (20 Feb 2010) + + 20 Feb 2010; Justin Lecher (jlec) <jlec@gentoo.org> + +files/1.3.2-python2.5.patch, +pmw-1.3.2-r2.ebuild: + Make deletecommand work with python 2.5, patched grabbed from debian 07 Feb 2010; Peter Volkov <pva@gentoo.org> pmw-1.3.2-r1.ebuild: Add inherit eutils: epatch is defined there. diff --git a/dev-python/pmw/files/1.3.2-python2.5.patch b/dev-python/pmw/files/1.3.2-python2.5.patch new file mode 100644 index 000000000000..ff8cce07ddaa --- /dev/null +++ b/dev-python/pmw/files/1.3.2-python2.5.patch @@ -0,0 +1,54 @@ +Source: http://github.com/nanotube/pmw_fixes/commit/5e6dcbdaef2bb6c40037b922dd0efa081f1575ab (Daniel Folkinshteyn) + +fix bug in OptionMenu.setitems, introduced with the fixing of this python +bug: +http://bugs.python.org/issue1342811 + +versions of python 2.5.4 and newer now automatically delete commands when +items are deleted +however, that causes error if the command is deleted manually beforehand. +old versions, on the contrary, require manual command deletion to free up +the objects. + +so we put in a python version check to see if we need to manually delete +commands. + +fixes the Pmw bug referred to here: +http://sourceforge.net/forum/forum.php?thread_id=3283195&forum_id=33675 +and here: +http://sourceforge.net/tracker/?func=detail&aid=2795731&group_id=10743&ati +d=110743 + +--- a/src/Pmw/Pmw_1_3/lib/PmwOptionMenu.py ++++ b/src/Pmw/Pmw_1_3/lib/PmwOptionMenu.py +@@ -1,6 +1,7 @@ + import types + import Tkinter + import Pmw ++import sys + + class OptionMenu(Pmw.MegaWidget): + +@@ -59,11 +60,17 @@ class OptionMenu(Pmw.MegaWidget): + + def setitems(self, items, index = None): + +- # Clean up old items and callback commands. +- for oldIndex in range(len(self._itemList)): +- tclCommandName = str(self._menu.entrycget(oldIndex, 'command')) +- if tclCommandName != '': +- self._menu.deletecommand(tclCommandName) ++ # python version check ++ # python versions >= 2.5.4 automatically clean commands ++ # and manually cleaning them causes errors when deleting items ++ ++ if sys.version_info[0] * 100 + sys.version_info[1] * 10 + \ ++ sys.version_info[2] < 254: ++ # Clean up old items and callback commands. ++ for oldIndex in range(len(self._itemList)): ++ tclCommandName = str(self._menu.entrycget(oldIndex, 'command')) ++ if tclCommandName != '': ++ self._menu.deletecommand(tclCommandName) + self._menu.delete(0, 'end') + self._itemList = list(items) + diff --git a/dev-python/pmw/pmw-1.3.2-r2.ebuild b/dev-python/pmw/pmw-1.3.2-r2.ebuild new file mode 100644 index 000000000000..7a698db3ea42 --- /dev/null +++ b/dev-python/pmw/pmw-1.3.2-r2.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pmw/pmw-1.3.2-r2.ebuild,v 1.1 2010/02/20 12:21:38 jlec Exp $ + +EAPI="2" +PYTHON_MODNAME="Pmw" + +inherit eutils distutils + +MY_P="Pmw.${PV}" + +DESCRIPTION="A toolkit for building high-level compound widgets in Python using the Tkinter module." +HOMEPAGE="http://pmw.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" + +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux" +LICENSE="BSD" +IUSE="doc examples" + +DEPEND="dev-lang/python[tk]" +RDEPEND="${DEPEND}" + +DOCS="${PYTHON_MODNAME}/README" +S="${WORKDIR}/${MY_P}/src" + +src_unpack() { + distutils_src_unpack + epatch "${FILESDIR}/${P}-install-no-docs.patch" + epatch "${FILESDIR}/${PV}-python2.5.patch" +} + +src_install() { + distutils_src_install + + local DIR + DIR="${S}/${PYTHON_MODNAME}/Pmw_1_3" + + if use doc; then + dohtml -a html,gif,py "${DIR}"/doc/* \ + || die "failed to install docs" + fi + + if use examples; then + insinto "${ROOT}/usr/share/doc/${PF}/examples" + doins "${DIR}"/demos/* \ + || die "failed to install demos" + fi + + #Tests are not unittests and show various + #GUIs. So we don't run them in the ebuild + +} |