send a new config message when config properties haven been changed

This commit is contained in:
Jakob Ketterl
2019-05-07 18:47:03 +02:00
parent 9fc77c2804
commit 35930f79f1
2 changed files with 20 additions and 7 deletions

View File

@ -9,7 +9,10 @@ class Property(object):
def setValue(self, value):
self.value = value
for c in self.callbacks:
c(self.value)
try:
c(self.value)
except Exception as e:
print(e)
return self
def wire(self, callback):
self.callbacks.append(callback)
@ -38,7 +41,10 @@ class PropertyManager(object):
self.properties[name] = prop
def fireCallbacks(value):
for c in self.callbacks:
c(name, value)
try:
c(name, value)
except Exception as e:
print(e)
prop.wire(fireCallbacks)
return self