summaryrefslogtreecommitdiffstats
path: root/layman/overlays
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-03-27 00:14:16 -0700
committerBrian Dolbec <brian.dolbec@gmail.com>2011-03-27 00:14:16 -0700
commiteab52f261bda8aef53675271357b3ca742f865ad (patch)
treeaf99cf145337612778b538f1ea54d6cdf233f9c5 /layman/overlays
parent34d7a5444ee72a7b6ca9193c2dc5975d0b894a8a (diff)
downloadlayman-eab52f261bda8aef53675271357b3ca742f865ad.tar.gz
layman-eab52f261bda8aef53675271357b3ca742f865ad.tar.bz2
layman-eab52f261bda8aef53675271357b3ca742f865ad.zip
migrate to explicit if check
Diffstat (limited to 'layman/overlays')
-rw-r--r--layman/overlays/overlay.py12
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 = config['output']
self._encoding_ = get_encoding(self.output)
- 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)
@@ -125,7 +125,7 @@ class Overlay(object):
raise Exception('Overlay is missing a "name" entry!')
_sources = xml.findall('source')
- if _sources:
+ if _sources != None:
_sources = [e for e in _sources if 'type' in e.attrib]
elif ('src' in xml.attrib) and ('type' in xml.attrib):
s = ET.Element('source', type=xml.attrib['type'])
@@ -242,7 +242,7 @@ class Overlay(object):
_sources = overlay['sources']
- if not _sources:
+ if _sources == None:
raise Exception('Overlay "' + self.name +
'" is missing a "source" entry!')
@@ -296,7 +296,7 @@ class Overlay(object):
self.status = None
self.quality = u'experimental'
- if overlay['quality']:
+ if len(overlay['quality']):
if overlay['quality'] in set(QUALITY_LEVELS):
self.quality = ensure_unicode(overlay['quality'])
@@ -485,7 +485,7 @@ class Overlay(object):
if self.irc != None:
result += u'\nIRC : ' + self.irc + u'\n'
- if self.feeds:
+ if len(self.feeds):
result += u'\n%s:' % ((len(self.feeds) == 1) and "Feed" or "Feeds")
for i in self.feeds:
result += u'\n %s' % i