From: "Gilles Dartiguelongue" <eva@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/eva:master commit in: dev-python/python-sjutils/files/, dev-python/python-sjutils/
Date: Sun, 18 Dec 2011 16:32:51 +0000 (UTC) [thread overview]
Message-ID: <597c14f4144ded19098814d55ffd453c16928492.eva@gentoo> (raw)
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
}
reply other threads:[~2011-12-18 16:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=597c14f4144ded19098814d55ffd453c16928492.eva@gentoo \
--to=eva@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox