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 1Qssqd-0000lM-7F for garchives@archives.gentoo.org; Mon, 15 Aug 2011 08:48:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6CBCC21C07B; Mon, 15 Aug 2011 08:48:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3DFFE21C0A0 for ; Mon, 15 Aug 2011 08:48:30 +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 B43161B4053 for ; Mon, 15 Aug 2011 08:48:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6CFE880048 for ; Mon, 15 Aug 2011 08:48:28 +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: <0976812c73afe48639cac0671c602a9d35f08908.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/basepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/basepm/depend.py X-VCS-Directories: gentoopm/basepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 0976812c73afe48639cac0671c602a9d35f08908 Date: Mon, 15 Aug 2011 08:48:28 +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: cf7cf8f38fd2ec6f0704e15d12f13ce9 commit: 0976812c73afe48639cac0671c602a9d35f08908 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Mon Aug 15 08:49:12 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Mon Aug 15 08:49:12 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D0976812c Migrate PMRequiredUseAtom to new StringCompat. --- gentoopm/basepm/depend.py | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gentoopm/basepm/depend.py b/gentoopm/basepm/depend.py index aad29ad..b765445 100644 --- a/gentoopm/basepm/depend.py +++ b/gentoopm/basepm/depend.py @@ -5,18 +5,20 @@ =20 from abc import abstractmethod, abstractproperty =20 -from ..util import ABCObject, StringCompat2 +from ..util import ABCObject, StringCompat =20 -class PMRequiredUseAtom(StringCompat2): +class PMRequiredUseAtom(StringCompat): """ An atom for C{REQUIRED_USE} specification. """ =20 - def __init__(self, s): - self._blocks =3D s.startswith('!') - if self._blocks: + def __new__(self, s): + rua =3D StringCompat.__new__(self, s) + rua._blocks =3D s.startswith('!') + if rua._blocks: s =3D s[1:] - self._flag =3D s + rua._flag =3D s + return rua =20 @property def name(self): @@ -45,10 +47,6 @@ class PMRequiredUseAtom(StringCompat2): """ return not self._blocks =20 - def __str__(self): - return '%s%s' % ('!' if self._blocks else '', - self.name) - class PMBaseDep(ABCObject): """ Base class for a dependency list holder.