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 1Qf5KV-0005C9-LP for garchives@archives.gentoo.org; Fri, 08 Jul 2011 07:18:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E6DC21C048; Fri, 8 Jul 2011 07:18:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 60B8F21C048 for ; Fri, 8 Jul 2011 07:18:20 +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 E07322AC0C6 for ; Fri, 8 Jul 2011 07:18:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E730D80042 for ; Fri, 8 Jul 2011 07:18:18 +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: Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/pkgcorepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/pkgcorepm/atom.py X-VCS-Directories: gentoopm/pkgcorepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: d6ad1d84ffb0ba44a9f4fd5271d61c55f817873d Date: Fri, 8 Jul 2011 07:18:18 +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: 55c40d33c949b529d4a4c073e8bc0157 commit: d6ad1d84ffb0ba44a9f4fd5271d61c55f817873d Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Jul 8 07:18:52 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Jul 8 07:18:52 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3Dd6ad1d84 pkgcore: support restriction creation and matching. --- gentoopm/pkgcorepm/atom.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/gentoopm/pkgcorepm/atom.py b/gentoopm/pkgcorepm/atom.py index 541470a..62043ae 100644 --- a/gentoopm/pkgcorepm/atom.py +++ b/gentoopm/pkgcorepm/atom.py @@ -3,7 +3,13 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 +from pkgcore.util.parserestrict import parse_match + from gentoopm.basepm.atom import PMAtom =20 class PkgCoreAtom(PMAtom): - pass + def __init__(self, s): + self._r =3D parse_match(s) + + def __contains__(self, pkg): + return self._r.match(pkg._pkg)