Skip to content
Snippets Groups Projects
Commit b2c500ac authored by Nicolas Mansard's avatar Nicolas Mansard Committed by Nicolas Mansard
Browse files

Added a protection to avoid erasing signal name when setting a new value to the signal.

parent c3460c30
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,12 @@ class Entity (object) : ...@@ -145,6 +145,12 @@ class Entity (object) :
except: except:
object.__getattr__(self, name) object.__getattr__(self, name)
def __setattr__(self, name, value):
if name in map(lambda s: s.getName().split(':')[-1],self.signals()):
raise NameError(name+" already designates a signal. "
"It is not advised to set a new attribute of the same name.")
object.__setattr__(self, name, value)
# --- COMMANDS BINDER ----------------------------------------------------- # --- COMMANDS BINDER -----------------------------------------------------
# List of all the entity classes from the c++ factory, that have been bound # List of all the entity classes from the c++ factory, that have been bound
# bind the py factory. # bind the py factory.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment