public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/eva:master commit in: dev-python/python-sjutils/files/, dev-python/python-sjutils/
@ 2011-12-18 16:32 Gilles Dartiguelongue
  0 siblings, 0 replies; only message in thread
From: Gilles Dartiguelongue @ 2011-12-18 16:32 UTC (permalink / raw
  To: gentoo-commits

commit:     597c14f4144ded19098814d55ffd453c16928492
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 14:40:27 2011 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 14:41:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/eva.git;a=commit;h=597c14f4

dev-python/python-sjutils: add patch for paginate function

---
 dev-python/python-sjutils/Manifest                 |    8 +++---
 .../files/python-sjutils-1.21.1-paginate.patch     |   29 ++++++++++++++++++++
 ...21.1.ebuild => python-sjutils-1.21.1-r1.ebuild} |    7 +++-
 3 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/dev-python/python-sjutils/Manifest b/dev-python/python-sjutils/Manifest
index 1e8b2f9..912e7b5 100644
--- a/dev-python/python-sjutils/Manifest
+++ b/dev-python/python-sjutils/Manifest
@@ -1,11 +1,11 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-DIST python-sjutils-1.21.1.tar.gz 28007 RMD160 655f1af83f176ce219dcaa392568f2e15078734f SHA1 fa372704fb02aeccfece72e72d2f6bd7e96f5a5b SHA256 6fc3028743900afc70ad52d2f717b5aa3f37793d2f55e458e0045585d73ace9d
+DIST python-sjutils-1.21.1-r1.tar.gz 28007 RMD160 655f1af83f176ce219dcaa392568f2e15078734f SHA1 fa372704fb02aeccfece72e72d2f6bd7e96f5a5b SHA256 6fc3028743900afc70ad52d2f717b5aa3f37793d2f55e458e0045585d73ace9d
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
-iEYEARECAAYFAk7ijz4ACgkQ1fmVwcYIWAb0hwCdGSES2VjMr+I1A5LGbnQEt6uh
-AS4An0RAQSj/99FOHg9peQ1NieEskFSz
-=bR0G
+iEYEARECAAYFAk7t+1sACgkQ1fmVwcYIWAZ4lwCfXr3FvuQDMGYUJQaaf1kyJyOB
+0EIAoKLZaLhzclrF5Ay+JYpCV83dZPvB
+=wUWv
 -----END PGP SIGNATURE-----

diff --git a/dev-python/python-sjutils/files/python-sjutils-1.21.1-paginate.patch b/dev-python/python-sjutils/files/python-sjutils-1.21.1-paginate.patch
new file mode 100644
index 0000000..98ac5df
--- /dev/null
+++ b/dev-python/python-sjutils/files/python-sjutils-1.21.1-paginate.patch
@@ -0,0 +1,29 @@
+diff --git a/sjutils/utils.py b/sjutils/utils.py
+index 8fc2dc9..314a673 100644
+--- a/sjutils/utils.py
++++ b/sjutils/utils.py
+@@ -164,3 +164,24 @@ def flatten_list(my_list):
+             result.append(elt)
+ 
+     return result
++
++def paginate(iterable, pagesize):
++    """
++    Pure generator-based paginate operator, from
++    http://paste.pocoo.org/show/173972/
++
++    paginate([1,2,3,4,5,6,7], 3) -> [[1,2,3], [4,5,6], [7]]
++
++    This function makes clever use of floor division for the groupby()
++    key function, so that the key changes every pagesize items,
++    prompting the yield of a new page.
++    """
++
++    import itertools
++    counter = itertools.count()
++
++    def key_function(elt):
++        return counter.next() // pagesize
++
++    for key, values in itertools.groupby(iterable, key_function):
++        yield values

diff --git a/dev-python/python-sjutils/python-sjutils-1.21.1.ebuild b/dev-python/python-sjutils/python-sjutils-1.21.1-r1.ebuild
similarity index 85%
rename from dev-python/python-sjutils/python-sjutils-1.21.1.ebuild
rename to dev-python/python-sjutils/python-sjutils-1.21.1-r1.ebuild
index 61f0437..4bba22f 100644
--- a/dev-python/python-sjutils/python-sjutils-1.21.1.ebuild
+++ b/dev-python/python-sjutils/python-sjutils-1.21.1-r1.ebuild
@@ -7,7 +7,7 @@ PYTHON_DEPEND="2:2.5"
 SUPPORT_PYTHON_ABIS="1"
 RESTRICT_PYTHON_ABIS="3.*"
 
-inherit autotools autotools-utils python
+inherit autotools autotools-utils eutils python
 
 DESCRIPTION="Collection of helper classes and functions used through various daemons at SmartJog"
 HOMEPAGE="https://github.com/SmartJog/python-sjutils"
@@ -31,7 +31,10 @@ pkg_setup() {
 
 src_prepare() {
 	eautoreconf
-	ln -sf $(type -p true) py-compile
+
+	# Add paginate function until newer version is released
+	epatch "${FILESDIR}/${P}-paginate.patch"
+
 	autotools-utils_src_prepare
 }
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-18 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-18 16:32 [gentoo-commits] dev/eva:master commit in: dev-python/python-sjutils/files/, dev-python/python-sjutils/ Gilles Dartiguelongue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox