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 1QjovO-0001CA-A0 for garchives@archives.gentoo.org; Thu, 21 Jul 2011 08:48:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C51E721C195; Thu, 21 Jul 2011 08:47:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 932EC21C1BF for ; Thu, 21 Jul 2011 08:47:22 +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 11D3C1B401E for ; Thu, 21 Jul 2011 08:47:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 518C88004F for ; Thu, 21 Jul 2011 08:47:21 +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: <7794ed5de6c3684fc8f68c9f4fc91b7920456c32.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/paludispm/repo.py X-VCS-Directories: gentoopm/paludispm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7794ed5de6c3684fc8f68c9f4fc91b7920456c32 Date: Thu, 21 Jul 2011 08:47:21 +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: 150bddba3056db99ba30a50a321a0122 commit: 7794ed5de6c3684fc8f68c9f4fc91b7920456c32 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Thu Jul 21 07:46:37 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Thu Jul 21 07:46:37 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D7794ed5d Paludis: split out PaludisBaseRepo. --- gentoopm/paludispm/repo.py | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py index e1be9cc..c4c5a12 100644 --- a/gentoopm/paludispm/repo.py +++ b/gentoopm/paludispm/repo.py @@ -3,6 +3,8 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 +from abc import abstractproperty + import paludis =20 from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \ @@ -23,17 +25,17 @@ class PaludisRepoDict(PMRepositoryDict): class PaludisEnumID(object): pass =20 -class PaludisRepository(PMRepository, PaludisPackageSet): +class PaludisBaseRepo(PMRepository, PaludisPackageSet): def __init__(self, env): PaludisPackageSet.__init__(self, env, True) =20 - @property + @abstractproperty def _gen(self): - return paludis.Generator.InRepository(self._repo.name) + pass =20 - @property + @abstractproperty def _filt(self): - return paludis.Filter.All() + pass =20 def __iter__(self): enum =3D PaludisEnumID() @@ -60,7 +62,16 @@ class PaludisRepository(PMRepository, PaludisPackageSe= t): else: return pset =20 -class PaludisAtomFilteredRepo(PaludisRepository): +class PaludisRepository(PaludisBaseRepo): + @property + def _gen(self): + return paludis.Generator.InRepository(self._repo.name) + + @property + def _filt(self): + return paludis.Filter.All() + +class PaludisAtomFilteredRepo(PaludisBaseRepo): @property def _gen(self): return self._mygen @@ -70,12 +81,12 @@ class PaludisAtomFilteredRepo(PaludisRepository): return self._myfilt =20 def __init__(self, repo, atom): - PaludisRepository.__init__(self, repo._env) + PaludisBaseRepo.__init__(self, repo._env) self._myfilt =3D repo._filt self._mygen =3D repo._gen & paludis.Generator.Matches(atom._atom, paludis.MatchPackageOptions()) =20 -class PaludisStackRepo(PaludisRepository): +class PaludisStackRepo(PaludisBaseRepo): @property def _gen(self): return paludis.Generator.All()