From 1c9edabaabd8a0ba65cbd52e1751d629788ac71a Mon Sep 17 00:00:00 2001 From: florent <florent@laas.fr> Date: Wed, 7 Jul 2010 09:27:00 +0200 Subject: [PATCH] Make classes derive from object and re-introduce getter and setter decorators * src/dynamic_graph/entity.py, * src/dynamic_graph/signal_base.py: getter and setter for signal value --- src/dynamic_graph/entity.py | 2 +- src/dynamic_graph/signal_base.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dynamic_graph/entity.py b/src/dynamic_graph/entity.py index eb0a0ee..57629e6 100644 --- a/src/dynamic_graph/entity.py +++ b/src/dynamic_graph/entity.py @@ -5,7 +5,7 @@ """ import wrap, signal_base -class Entity: +class Entity (object) : """ This class binds dynamicgraph::Entity C++ class """ diff --git a/src/dynamic_graph/signal_base.py b/src/dynamic_graph/signal_base.py index a2454c8..83f6b46 100644 --- a/src/dynamic_graph/signal_base.py +++ b/src/dynamic_graph/signal_base.py @@ -5,7 +5,7 @@ """ import wrap -class SignalBase: +class SignalBase (object) : """ This class binds dynamicgraph::SignalBase<int> C++ class """ @@ -29,13 +29,15 @@ class SignalBase: """ return wrap.signalBaseGetTime(self.object) - def get_value(self) : + @property + def value(self) : """ Read the value of a signal """ return wrap.signal_base_get_value(self.object) - def set_value(self, val) : + @value.setter + def value(self, val) : """ Set the signal as a constant signal with given value. If the signal is plugged, it will be unplugged -- GitLab