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 1QhiVR-0008GE-LM for garchives@archives.gentoo.org; Fri, 15 Jul 2011 13:32:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C0FB421C0D7; Fri, 15 Jul 2011 13:32:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8FC7621C0D7 for ; Fri, 15 Jul 2011 13:32:05 +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 1079F1BC0E5 for ; Fri, 15 Jul 2011 13:32:05 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 594B98004A for ; Fri, 15 Jul 2011 13:32:03 +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/basepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/basepm/pkg.py gentoopm/basepm/repo.py X-VCS-Directories: gentoopm/basepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: e4fde2fcba55f039ea136a630e69e4633daaff52 Date: Fri, 15 Jul 2011 13:32:03 +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: 5011b6f2792f4c4cd98f444b28827c20 commit: e4fde2fcba55f039ea136a630e69e4633daaff52 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Jul 15 13:15:22 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Jul 15 13:15:56 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3De4fde2fc Predefine simple '=3D=3D' operators. --- gentoopm/basepm/pkg.py | 5 +++++ gentoopm/basepm/repo.py | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/gentoopm/basepm/pkg.py b/gentoopm/basepm/pkg.py index ccdd5ce..ad3e1f1 100644 --- a/gentoopm/basepm/pkg.py +++ b/gentoopm/basepm/pkg.py @@ -273,5 +273,10 @@ class PMPackage(ABCObject): bz2 =3D True return PMPackageEnvironment(p, bzipped2 =3D bz2) =20 + def __eq__(self, other): + if not isinstance(other, self.__class__): + return False + return self.id =3D=3D other.id + def __repr__(self): return '%s(%s)' % (self.__class__.__name__, repr(self.id)) diff --git a/gentoopm/basepm/repo.py b/gentoopm/basepm/repo.py index 721804d..b4ce8ce 100644 --- a/gentoopm/basepm/repo.py +++ b/gentoopm/basepm/repo.py @@ -95,5 +95,10 @@ class PMEbuildRepository(PMRepository): """ pass =20 + def __eq__(self, other): + if not isinstance(other, self.__class__): + return False + return self.name =3D=3D other.name and self.path =3D=3D other.path + def __repr__(self): return '%s(%s)' % (self.__class__.__name__, repr(self.name))