Skip to content
Snippets Groups Projects
Commit 04185020 authored by florent's avatar florent
Browse files

Replace object member by obj in classes

	* src/dynamic_graph/__init__.py,
	* src/dynamic_graph/entity.py,
	* src/dynamic_graph/signal_base.py: object is a keyword in python.
parent 2c47031a
No related branches found
No related tags found
No related merge requests found
......@@ -12,4 +12,4 @@ def plug (signalOut, signalIn) :
Plug an output signal into an input signal
"""
# get signals and entities
w_plug(signalOut.object, signalIn.object)
w_plug(signalOut.obj, signalIn.obj)
......@@ -9,7 +9,7 @@ entityClassNameList = []
def commandMethod(name, docstring) :
def method(self, *arg):
return wrap.entity_execute_command(self.object, name, arg)
return wrap.entity_execute_command(self.obj, name, arg)
method.__doc__ = docstring
return method
......@@ -20,10 +20,10 @@ def initEntity(self, name):
Entity.__init__(self, self.className, name)
if not self.__class__.commandCreated:
# Get list of commands of the Entity object
commands = wrap.entity_list_commands(self.object)
commands = wrap.entity_list_commands(self.obj)
# for each command, add a method with the name of the command
for command in commands:
docstring = wrap.entity_get_command_docstring(self.object, command)
docstring = wrap.entity_get_command_docstring(self.obj, command)
setattr(self.__class__, command, commandMethod(command, docstring))
self.__class__.commandCreated = True
......@@ -55,29 +55,29 @@ class Entity (object) :
This class binds dynamicgraph::Entity C++ class
"""
object = None
obj = None
def __init__(self, className, instanceName):
"""
Constructor: if not called by a child class, create and store a pointer
to a C++ Entity object.
"""
self.object = wrap.create_entity(className, instanceName)
self.obj = wrap.create_entity(className, instanceName)
@property
def name(self) :
return wrap.entity_get_name(self.object)
return wrap.entity_get_name(self.obj)
def signal (self, name) :
"""
Get a signal of the entity from signal name
"""
signalPt = wrap.entity_get_signal(self.object, name)
signalPt = wrap.entity_get_signal(self.obj, name)
return signal_base.SignalBase("", signalPt)
def display_signals(self) :
"""
Write the list of signals into standard output: temporary.
"""
wrap.entity_display_signals(self.object)
wrap.entity_display_signals(self.obj)
......@@ -145,24 +145,24 @@ class SignalBase (object) :
This class binds dynamicgraph::SignalBase<int> C++ class
"""
object = None
obj = None
def __init__(self, name, object = None) :
def __init__(self, name, obj = None) :
"""
Constructor: if not called by a child class, create and store a pointer
to a C++ SignalBase<int> object.
"""
if object :
self.object = object
if not self.object :
self.object = wrap.create_signal_base(self, name)
if obj :
self.obj = obj
if not self.obj :
self.obj = wrap.create_signal_base(self, name)
@property
def time(self) :
"""
Get time of signal
"""
return wrap.signalBaseGetTime(self.object)
return wrap.signal_base_get_time(self.obj)
@property
def value(self) :
......@@ -185,7 +185,7 @@ class SignalBase (object) :
>>> s.value
(2.5, 0.1, 100.0)
"""
string = wrap.signal_base_get_value(self.object)
string = wrap.signal_base_get_value(self.obj)
return stringToObject(string)
@value.setter
......@@ -195,4 +195,4 @@ class SignalBase (object) :
If the signal is plugged, it will be unplugged
"""
string = objectToString(val)
return wrap.signal_base_set_value(self.object, string)
return wrap.signal_base_set_value(self.obj, string)
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