Don't compare with bool values
This commit is contained in:
1 parent
3b820f6848
commit
97d0fbd2c9
5 files changed
+5
-5
No files matched your search
@@ -44,7 +44,7 @@ class OctoPrintPermission(Permission):
|
||||
def __init__(self, name, description, *needs, **kwargs):
|
||||
self._name = name
|
||||
self._description = description
|
||||
self._dangerous = kwargs.pop("dangerous", False) == True
|
||||
self._dangerous = kwargs.pop("dangerous", False)
|
||||
self._default_groups = kwargs.pop("default_groups", [])
|
||||
|
||||
self._key = None
|
||||
|
||||
@@ -675,7 +675,7 @@ class Profile(object):
|
||||
elif isinstance(value, (int, float)):
|
||||
return value > 0
|
||||
else:
|
||||
return value == True
|
||||
return bool(value)
|
||||
|
||||
def get_microns(self, key, default=None):
|
||||
value = self.get_float(key, default=None)
|
||||
|
||||
@@ -1823,7 +1823,7 @@ class Server(object):
|
||||
|
||||
roles = definition.get("roles", [])
|
||||
description = definition.get("description", "")
|
||||
dangerous = definition.get("dangerous", False) == True
|
||||
dangerous = definition.get("dangerous", False)
|
||||
default_groups = definition.get("default_groups", [])
|
||||
|
||||
roles_and_permissions = [permission_role(plugin_info.key, role) for role in roles] + permissions
|
||||
|
||||
@@ -18,5 +18,5 @@ def getChipFromDB(sig):
|
||||
for chip in avrChipDB.values():
|
||||
if chip['signature'] == sig:
|
||||
return chip
|
||||
return False
|
||||
return None
|
||||
|
||||
@@ -11,7 +11,7 @@ class IspBase():
|
||||
def programChip(self, flashData):
|
||||
self.curExtAddr = -1
|
||||
self.chip = chipDB.getChipFromDB(self.getSignature())
|
||||
if self.chip == False:
|
||||
if not self.chip:
|
||||
raise IspError("Chip with signature: " + str(self.getSignature()) + "not found")
|
||||
self.chipErase()
|
||||
|
||||
|
||||
Reference in new issue
Block a user