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 1QF2Ts-0003d3-Bn for garchives@archives.gentoo.org; Wed, 27 Apr 2011 11:00:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8D8221C0BE; Wed, 27 Apr 2011 10:58:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5F4A51C0BD for ; Wed, 27 Apr 2011 10:58:46 +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 B703D2AC00D for ; Wed, 27 Apr 2011 10:58:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 25BD38050B for ; Wed, 27 Apr 2011 10:58:45 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/ X-VCS-Repository: proj/layman X-VCS-Files: layman/overlays/overlay.py X-VCS-Directories: layman/overlays/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: eab52f261bda8aef53675271357b3ca742f865ad Date: Wed, 27 Apr 2011 10:58:45 +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: 9b0a7f413ac3efddff667de556b658a9 commit: eab52f261bda8aef53675271357b3ca742f865ad Author: Brian Dolbec gmail com> AuthorDate: Sun Mar 27 07:14:16 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Mar 27 07:14:16 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3Deab52f26 migrate to explicit if check --- layman/overlays/overlay.py | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index b99c052..9486c38 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -101,9 +101,9 @@ class Overlay(object): self.output =3D config['output'] self._encoding_ =3D get_encoding(self.output) =20 - if xml: + if xml is not None: self.from_xml(xml, ignore, quiet) - elif ovl_dict: + elif ovl_dict is not None: self.from_dict(ovl_dict, ignore, quiet) =20 =20 @@ -125,7 +125,7 @@ class Overlay(object): raise Exception('Overlay is missing a "name" entry!') =20 _sources =3D xml.findall('source') - if _sources: + if _sources !=3D None: _sources =3D [e for e in _sources if 'type' in e.attrib] elif ('src' in xml.attrib) and ('type' in xml.attrib): s =3D ET.Element('source', type=3Dxml.attrib['type']) @@ -242,7 +242,7 @@ class Overlay(object): =20 _sources =3D overlay['sources'] =20 - if not _sources: + if _sources =3D=3D None: raise Exception('Overlay "' + self.name + '" is missing a "source" entry!') =20 @@ -296,7 +296,7 @@ class Overlay(object): self.status =3D None =20 self.quality =3D u'experimental' - if overlay['quality']: + if len(overlay['quality']): if overlay['quality'] in set(QUALITY_LEVELS): self.quality =3D ensure_unicode(overlay['quality']) =20 @@ -485,7 +485,7 @@ class Overlay(object): if self.irc !=3D None: result +=3D u'\nIRC : ' + self.irc + u'\n' =20 - if self.feeds: + if len(self.feeds): result +=3D u'\n%s:' % ((len(self.feeds) =3D=3D 1) and "Feed= " or "Feeds") for i in self.feeds: result +=3D u'\n %s' % i