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 1Qj959-0003rt-Cf for garchives@archives.gentoo.org; Tue, 19 Jul 2011 12:07:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB1E821C2EB; Tue, 19 Jul 2011 12:07:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7DBD021C2EB for ; Tue, 19 Jul 2011 12:07:15 +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 F03661BC022 for ; Tue, 19 Jul 2011 12:07:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D6CD78003D for ; Tue, 19 Jul 2011 12:07:13 +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: <19300f0c5f60565ef89f17106c06236bddd380f0.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/util.py X-VCS-Directories: gentoopm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 19300f0c5f60565ef89f17106c06236bddd380f0 Date: Tue, 19 Jul 2011 12:07:13 +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: a99239724ea2128d713147cb29a8e139 commit: 19300f0c5f60565ef89f17106c06236bddd380f0 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Tue Jul 19 12:08:03 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Tue Jul 19 12:08:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D19300f0c Add __bool__() to StringWrapper. --- gentoopm/util.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/gentoopm/util.py b/gentoopm/util.py index 76938d8..0329606 100644 --- a/gentoopm/util.py +++ b/gentoopm/util.py @@ -49,6 +49,12 @@ class StringWrapper(object): def __str__(self): return str(self._s) =20 + def __bool__(self): + return bool(str(self)) + + def __nonzero__(self): + return self.__bool__(self) + def __repr__(self): return '(%s)' % repr(str(self)) =20