Cleanup of some functions
This commit is contained in:
parent
8ee61ff7a4
commit
4d6deaeaa3
12
bindings.py
12
bindings.py
|
|
@ -375,24 +375,22 @@ class analogController(object):
|
||||||
try:
|
try:
|
||||||
typ=_MATCHS[match.group("msg")]
|
typ=_MATCHS[match.group("msg")]
|
||||||
# self.messages[typ]=match # Not very clever tho
|
# self.messages[typ]=match # Not very clever tho
|
||||||
|
if typ in _UPDATE_MSG:
|
||||||
|
self.feedback.receiveMessage(typ,match)
|
||||||
status=self.POSTMATCHACTIONS[typ](match)
|
status=self.POSTMATCHACTIONS[typ](match)
|
||||||
if status:
|
if status:
|
||||||
self._LOCKS[typ].release()
|
self._LOCKS[typ].release()
|
||||||
if typ in _UPDATE_MSG:
|
|
||||||
return self.feedback.receiveMessage(typ,match) #Do an actual action
|
|
||||||
else:
|
else:
|
||||||
if typ in _UPDATE_MSG:
|
dprint("Ignoring message",match)
|
||||||
return self.feedback.receiveMessage(typ,match)
|
|
||||||
else:
|
|
||||||
dprint("Ignoring message",match)
|
|
||||||
return status
|
return status
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
dprint("Lock [{}] is already released (async terminated earlier)".format(typ))
|
dprint("Lock [{}] is already released (async terminated earlier)".format(typ))
|
||||||
dprint("This message is either comming from the device or garbage data")
|
dprint("This message is either comming from the device or garbage data")
|
||||||
dprint(e)
|
dprint(e)
|
||||||
|
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
eprint("There is no lock associated with {}".format(typ))
|
eprint("There is no lock associated with {}".format(typ))
|
||||||
print(e)
|
eprint(e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue