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 1QSNLJ-0001Fb-Ut for garchives@archives.gentoo.org; Fri, 03 Jun 2011 05:54:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5077B1C066; Fri, 3 Jun 2011 05:54:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 23A6D1C066 for ; Fri, 3 Jun 2011 05:54:37 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A91161B4029 for ; Fri, 3 Jun 2011 05:54:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 19ED08050C for ; Fri, 3 Jun 2011 05:54:36 +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: <839be1617c598b04d477c3ec166162532e411b2d.mgorny@gentoo> Subject: [gentoo-commits] proj/pms-test-suite:master commit in: PMSTestSuite/repository/ X-VCS-Repository: proj/pms-test-suite X-VCS-Files: PMSTestSuite/repository/__init__.py X-VCS-Directories: PMSTestSuite/repository/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 839be1617c598b04d477c3ec166162532e411b2d Date: Fri, 3 Jun 2011 05:54:36 +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: 5ed9856990b7ff15e0825eb96fc3d2bd commit: 839be1617c598b04d477c3ec166162532e411b2d Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Jun 3 05:54:41 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Jun 3 05:54:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/pms-test-suit= e.git;a=3Dcommit;h=3D839be161 Support adding multiple categories in one call. --- PMSTestSuite/repository/__init__.py | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/PMSTestSuite/repository/__init__.py b/PMSTestSuite/repositor= y/__init__.py index 8dba079..5e6d897 100644 --- a/PMSTestSuite/repository/__init__.py +++ b/PMSTestSuite/repository/__init__.py @@ -56,8 +56,7 @@ class EbuildRepository(object): if cat and cat not in self.categories: newcats.add(cat) =20 - for c in newcats: - self.add_category(cat, files) + self.add_categories(newcats, files) =20 for fn, c in files.items(): fp =3D os.path.join(self.path, fn) @@ -76,9 +75,9 @@ class EbuildRepository(object): dirs.add(os.path.join(self.path, os.path.dirname(fn))) pm.remanifest(dirs) =20 - def add_category(self, catname, files): + def add_categories(self, cats, files): """ - Add category to profiles/categories. Update + Add categories in to profiles/categories. Update the profiles/categories file in dict. """ raise ValueError("The repository doesn't support %s category." % catna= me) @@ -104,9 +103,9 @@ class NewEbuildRepository(EbuildRepository): =20 EbuildRepository.__init__(self, path) =20 - def add_category(self, catname, files): + def add_categories(self, cats, files): # XXX: profiles/categories can contain new categories already # and they may not be in self.categories - self.categories.append(catname) + self.categories.extend(cats) newcats =3D '\n'.join(self.categories) files[os.path.join('profiles', 'categories')] =3D newcats