Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/
Date: Wed, 27 Apr 2011 11:00:28
Message-Id: eab52f261bda8aef53675271357b3ca742f865ad.dol-sen@gentoo
1 commit: eab52f261bda8aef53675271357b3ca742f865ad
2 Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
3 AuthorDate: Sun Mar 27 07:14:16 2011 +0000
4 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
5 CommitDate: Sun Mar 27 07:14:16 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=eab52f26
7
8 migrate to explicit if check
9
10 ---
11 layman/overlays/overlay.py | 12 ++++++------
12 1 files changed, 6 insertions(+), 6 deletions(-)
13
14 diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
15 index b99c052..9486c38 100644
16 --- a/layman/overlays/overlay.py
17 +++ b/layman/overlays/overlay.py
18 @@ -101,9 +101,9 @@ class Overlay(object):
19 self.output = config['output']
20 self._encoding_ = get_encoding(self.output)
21
22 - if xml:
23 + if xml is not None:
24 self.from_xml(xml, ignore, quiet)
25 - elif ovl_dict:
26 + elif ovl_dict is not None:
27 self.from_dict(ovl_dict, ignore, quiet)
28
29
30 @@ -125,7 +125,7 @@ class Overlay(object):
31 raise Exception('Overlay is missing a "name" entry!')
32
33 _sources = xml.findall('source')
34 - if _sources:
35 + if _sources != None:
36 _sources = [e for e in _sources if 'type' in e.attrib]
37 elif ('src' in xml.attrib) and ('type' in xml.attrib):
38 s = ET.Element('source', type=xml.attrib['type'])
39 @@ -242,7 +242,7 @@ class Overlay(object):
40
41 _sources = overlay['sources']
42
43 - if not _sources:
44 + if _sources == None:
45 raise Exception('Overlay "' + self.name +
46 '" is missing a "source" entry!')
47
48 @@ -296,7 +296,7 @@ class Overlay(object):
49 self.status = None
50
51 self.quality = u'experimental'
52 - if overlay['quality']:
53 + if len(overlay['quality']):
54 if overlay['quality'] in set(QUALITY_LEVELS):
55 self.quality = ensure_unicode(overlay['quality'])
56
57 @@ -485,7 +485,7 @@ class Overlay(object):
58 if self.irc != None:
59 result += u'\nIRC : ' + self.irc + u'\n'
60
61 - if self.feeds:
62 + if len(self.feeds):
63 result += u'\n%s:' % ((len(self.feeds) == 1) and "Feed" or "Feeds")
64 for i in self.feeds:
65 result += u'\n %s' % i