Simplified tool bit editor using property-bags

This commit is contained in:
Markus Lampert
2020-12-30 21:58:37 -08:00
parent 79b63bd521
commit de1a64f090
5 changed files with 194 additions and 383 deletions

View File

@@ -71,6 +71,11 @@ def getPropertyValueString(obj, prop):
def setProperty(obj, prop, value):
'''setProperty(obj, prop, value) ... set the property value of obj's property defined by its canonical name.'''
o, attr, name = _getProperty(obj, prop) # pylint: disable=unused-variable
if attr and type(value) == str:
if type(attr) == int:
value = int(value, 0)
elif type(attr) == bool:
value = value.lower() in ['true', '1', 'yes', 'ok']
if o and name:
setattr(o, name, value)