Change how spel checking and booleans in general are saved in the XML

This commit is contained in:
Veronica Berglyd Olsen
2022-11-07 22:46:30 +01:00
parent 42f2bf3628
commit 26f7bb4b32
20 changed files with 622 additions and 572 deletions
+9 -2
View File
@@ -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.