Change how spel checking and booleans in general are saved in the XML
This commit is contained in:
@@ -88,9 +88,10 @@ def checkBool(value, default):
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
elif isinstance(value, str):
|
||||
if value == "True":
|
||||
check = value.lower()
|
||||
if check in ("true", "yes", "on"):
|
||||
return True
|
||||
elif value == "False":
|
||||
elif check in ("false", "no", "off"):
|
||||
return False
|
||||
else:
|
||||
return default
|
||||
@@ -259,6 +260,12 @@ def simplified(string):
|
||||
return " ".join(str(string).strip().split())
|
||||
|
||||
|
||||
def yesNo(value):
|
||||
"""Convert a boolean evaluated variable to a yes or no.
|
||||
"""
|
||||
return "yes" if value else "no"
|
||||
|
||||
|
||||
def splitVersionNumber(value):
|
||||
"""Split a version string on the form aa.bb.cc into major, minor
|
||||
and patch, and computes an integer value aabbcc.
|
||||
|
||||
Reference in New Issue
Block a user