From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QsALq-0003EK-6Y for garchives@archives.gentoo.org; Sat, 13 Aug 2011 09:17:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8A28721C4C0; Sat, 13 Aug 2011 09:17:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5B70E21C4C0 for ; Sat, 13 Aug 2011 09:17:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CE64D1B4001 for ; Sat, 13 Aug 2011 09:17:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 05AEA80040 for ; Sat, 13 Aug 2011 09:17:45 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <017172493ded87ad77cb197f3c65ec8d81db9485.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/basepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/basepm/filter.py gentoopm/basepm/pkgset.py X-VCS-Directories: gentoopm/basepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 017172493ded87ad77cb197f3c65ec8d81db9485 Date: Sat, 13 Aug 2011 09:17:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c5a5ac8d6fbba6c4353400ce50fafa51 commit: 017172493ded87ad77cb197f3c65ec8d81db9485 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sat Aug 13 09:07:27 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sat Aug 13 09:18:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D01717249 Fix concatenating kwfilters, use itertools. --- gentoopm/basepm/filter.py | 5 ++--- gentoopm/basepm/pkgset.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gentoopm/basepm/filter.py b/gentoopm/basepm/filter.py index a43fad6..1d704b5 100644 --- a/gentoopm/basepm/filter.py +++ b/gentoopm/basepm/filter.py @@ -102,8 +102,7 @@ def transform_keyword_filters(kwargs): @param kwargs: keyword arguments, as passed to L{PMPackageSet.filter()} @type kwargs: dict @return: positional arguments representing the keyword filters - @rtype: tuple + @rtype: iter(L{AttributeMatch}) """ =20 - return tuple([PMTransformedKeywordFilter(k, v) - for k, v in kwargs.items()]) + return itertools.starmap(PMTransformedKeywordFilter, kwargs.items()) diff --git a/gentoopm/basepm/pkgset.py b/gentoopm/basepm/pkgset.py index bf8c66a..390cde9 100644 --- a/gentoopm/basepm/pkgset.py +++ b/gentoopm/basepm/pkgset.py @@ -3,6 +3,7 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 +import itertools from abc import abstractmethod =20 from .filter import transform_keyword_filters @@ -173,7 +174,8 @@ class PMPackageSet(ABCObject, BoolCompat): class PMFilteredPackageSet(PMPackageSet): def __init__(self, src, args, kwargs): self._src =3D src - self._args =3D args + transform_keyword_filters(kwargs) + self._args =3D tuple(itertools.chain(args, + transform_keyword_filters(kwargs))) =20 def __iter__(self): for el in self._src: