forked from openlp/openlp
Comparison to None is discouraged
This commit is contained in:
parent
1830cfbe9e
commit
ef3e3252e7
@ -149,7 +149,7 @@ class CategoryList(object):
|
|||||||
return self.__next__()
|
return self.__next__()
|
||||||
|
|
||||||
def has_key(self, key):
|
def has_key(self, key):
|
||||||
if key != None and not isinstance(key, unicode):
|
if key and not isinstance(key, unicode):
|
||||||
key = unicode(key)
|
key = unicode(key)
|
||||||
for category in self.categories:
|
for category in self.categories:
|
||||||
if category.name == key:
|
if category.name == key:
|
||||||
@ -166,7 +166,7 @@ class CategoryList(object):
|
|||||||
self.add(name, weight)
|
self.add(name, weight)
|
||||||
|
|
||||||
def add(self, name, weight=0, actions=None):
|
def add(self, name, weight=0, actions=None):
|
||||||
if name != None and not isinstance(name, unicode):
|
if name and not isinstance(name, unicode):
|
||||||
name = unicode(name)
|
name = unicode(name)
|
||||||
category = ActionCategory(name, weight)
|
category = ActionCategory(name, weight)
|
||||||
if actions:
|
if actions:
|
||||||
@ -274,7 +274,7 @@ class ActionList(object):
|
|||||||
``weight``
|
``weight``
|
||||||
The category's weight (int).
|
The category's weight (int).
|
||||||
"""
|
"""
|
||||||
if name != None and not isinstance(name, unicode):
|
if name and not isinstance(name, unicode):
|
||||||
name = unicode(name)
|
name = unicode(name)
|
||||||
if name in self.categories:
|
if name in self.categories:
|
||||||
# Only change the weight and resort the categories again.
|
# Only change the weight and resort the categories again.
|
||||||
|
Loading…
Reference in New Issue
Block a user