commit e64acc18f6504906b0ce36bf0ed53808d0109c8c
parent 51151814447f762424dd5657997d96160a9ee261
Author: Dan Callaghan <djc@djc.id.au>
Date: Mon, 2 May 2011 14:54:11 +1000
Genshi: bump to 0.6
Diffstat:
4 files changed, 30 insertions(+), 153 deletions(-)
diff --git a/packages/dev-python/Genshi/Genshi-0.5.1.exheres-0 b/packages/dev-python/Genshi/Genshi-0.5.1.exheres-0
@@ -1,37 +0,0 @@
-# Copyright 2011 Dan Callaghan <djc@djc.id.au>
-# Distributed under the terms of the GNU General Public License v2
-
-require distutils [ python_dep=2.3 ] pypi
-
-SUMMARY="Python toolkit for stream-based generation of output for the web"
-HOMEPAGE="http://genshi.edgewall.org/"
-DOWNLOADS="ftp://ftp.edgewall.com/pub/genshi/${PNV}.tar.bz2"
-
-LICENCES="BSD"
-SLOT="0"
-PLATFORMS="~amd64 ~x86"
-MYOPTIONS="doc examples"
-
-BUGS_TO="djc@djc.id.au"
-
-RESTRICT="test" # they fail
-
-DEFAULT_SRC_PREPARE_PATCHES=(
- "${FILES}/markup-join-typeerror.patch"
- "${FILES}/markup-join-iterable.patch"
-)
-
-src_test() {
- edo python setup.py test
-}
-
-src_install() {
- distutils_src_install
- if option doc ; then
- dodoc -r doc/*
- fi
- if option examples ; then
- insinto /usr/share/doc/${PNV}
- doins -r examples
- fi
-}
diff --git a/packages/dev-python/Genshi/Genshi-0.6.exheres-0 b/packages/dev-python/Genshi/Genshi-0.6.exheres-0
@@ -0,0 +1,30 @@
+# Copyright 2011 Dan Callaghan <djc@djc.id.au>
+# Distributed under the terms of the GNU General Public License v2
+
+require distutils [ python_dep=2.4 ] pypi
+
+SUMMARY="Python toolkit for stream-based generation of output for the web"
+HOMEPAGE="http://genshi.edgewall.org/"
+DOWNLOADS="ftp://ftp.edgewall.com/pub/genshi/${PNV}.tar.gz"
+
+LICENCES="BSD"
+SLOT="0"
+PLATFORMS="~amd64 ~x86"
+MYOPTIONS="doc examples"
+
+BUGS_TO="djc@djc.id.au"
+
+src_test() {
+ edo python setup.py test
+}
+
+src_install() {
+ distutils_src_install
+ if option doc ; then
+ dodoc -r doc/*
+ fi
+ if option examples ; then
+ insinto /usr/share/doc/${PNV}
+ doins -r examples
+ fi
+}
diff --git a/packages/dev-python/Genshi/files/markup-join-iterable.patch b/packages/dev-python/Genshi/files/markup-join-iterable.patch
@@ -1,85 +0,0 @@
-Source: Dan Callaghan <djc@djc.id.au>
-Upstream: http://genshi.edgewall.org/ticket/258
-Reason: bug fix
-
-diff -r 66f293fadcc5 -r 2256364c3a98 genshi/_speedups.c
---- Genshi-0.5.1/genshi/_speedups.c Sun Aug 31 19:15:36 2008 +1000
-+++ Genshi-0.5.1/genshi/_speedups.c Sun Aug 31 19:19:36 2008 +1000
-@@ -229,40 +229,36 @@
- static PyObject *
- Markup_join(PyObject *self, PyObject *args, PyObject *kwds)
- {
-- static char *kwlist[] = {"seq", "escape_quotes", 0};
-- PyObject *seq = NULL, *seq2, *tmp, *tmp2;
-+ static char *kwlist[] = {"iterable", "escape_quotes", 0};
-+ PyObject *iterable = NULL, *iterator, *iteritem, *seq2, *tmp, *tmp2;
- char quotes = 1;
-- int n, i;
-
-- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|b", kwlist, &seq, "es)) {
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|b", kwlist,
-+ &iterable, "es)) {
- return NULL;
- }
-- if (!PySequence_Check(seq)) {
-- PyErr_FromString(PyExc_TypeError, "a sequence is required");
-+ iterator = PyObject_GetIter(iterable);
-+ if (iterator == NULL)
- return NULL;
-- }
-- n = PySequence_Size(seq);
-- if (n < 0) {
-- return NULL;
-- }
-- seq2 = PyTuple_New(n);
-+ seq2 = PyList_New(0);
- if (seq2 == NULL) {
- return NULL;
- }
-- for (i = 0; i < n; i++) {
-- tmp = PySequence_GetItem(seq, i);
-- if (tmp == NULL) {
-- Py_DECREF(seq2);
-- return NULL;
-- }
-- tmp2 = escape(tmp, quotes);
-+ while ((iteritem = PyIter_Next(iterator))) {
-+ tmp2 = escape(iteritem, quotes);
-+ Py_DECREF(iteritem);
- if (tmp2 == NULL) {
- Py_DECREF(seq2);
- return NULL;
- }
-- PyTuple_SET_ITEM(seq2, i, tmp2);
-- Py_DECREF(tmp);
-+ if (PyList_Append(seq2, tmp2) < 0) {
-+ Py_DECREF(tmp2);
-+ return NULL;
-+ }
-+ Py_DECREF(tmp2);
- }
-+ if (PyErr_Occurred()) // in PyIter_Next above
-+ return NULL;
- tmp = PyUnicode_Join(self, seq2);
- Py_DECREF(seq2);
- if (tmp == NULL)
-diff -r 66f293fadcc5 -r 2256364c3a98 genshi/tests/core.py
---- Genshi-0.5.1/genshi/tests/core.py Sun Aug 31 19:15:36 2008 +1000
-+++ Genshi-0.5.1/genshi/tests/core.py Sun Aug 31 19:19:36 2008 +1000
-@@ -136,6 +136,16 @@
- assert type(markup) is Markup
- self.assertEquals('foo<br /><bar /><br /><baz />', markup)
-
-+ def test_join_iterable(self):
-+ """
-+ Tests calling Markup.join with an argument which is iterable, but not
-+ a sequence.
-+ """
-+ markup = Markup('<br />').join(x for x in
-+ ['foo', '<bar />', Markup('<baz />')])
-+ assert type(markup) is Markup
-+ self.assertEquals('foo<br /><bar /><br /><baz />', markup)
-+
- def test_join_wrongtype(self):
- """
- Tests calling Markup.join with an argument whose type is nonsensical.
diff --git a/packages/dev-python/Genshi/files/markup-join-typeerror.patch b/packages/dev-python/Genshi/files/markup-join-typeerror.patch
@@ -1,31 +0,0 @@
-Source: Dan Callaghan <djc@djc.id.au>
-Upstream: http://genshi.edgewall.org/ticket/258
-Reason: bug fix
-
-diff -r 40ef4b6f2654 -r 66f293fadcc5 genshi/_speedups.c
---- Genshi-0.5.1/genshi/_speedups.c Sun Aug 31 19:14:34 2008 +1000
-+++ Genshi-0.5.1/genshi/_speedups.c Sun Aug 31 19:15:36 2008 +1000
-@@ -238,6 +238,7 @@
- return NULL;
- }
- if (!PySequence_Check(seq)) {
-+ PyErr_FromString(PyExc_TypeError, "a sequence is required");
- return NULL;
- }
- n = PySequence_Size(seq);
-diff -r 40ef4b6f2654 -r 66f293fadcc5 genshi/tests/core.py
---- Genshi-0.5.1/genshi/tests/core.py Sun Aug 31 19:14:34 2008 +1000
-+++ Genshi-0.5.1/genshi/tests/core.py Sun Aug 31 19:15:36 2008 +1000
-@@ -136,6 +136,12 @@
- assert type(markup) is Markup
- self.assertEquals('foo<br /><bar /><br /><baz />', markup)
-
-+ def test_join_wrongtype(self):
-+ """
-+ Tests calling Markup.join with an argument whose type is nonsensical.
-+ """
-+ self.assertRaises(TypeError, lambda: Markup('<br />').join(0.5))
-+
- def test_stripentities_all(self):
- markup = Markup('& j').stripentities()
- assert type(markup) is Markup