Salome HOME
[PythonAPI] Remove the word shaper from some places in PythonAPI
[modules/shaper.git] / src / PythonAPI / model / parameter / parameter.py
index a39810c7a6a1aabc92a730592ac80da282d6ac2d..9bc5b5a075ea1175a01e491244238ff3f71e6e6f 100644 (file)
@@ -9,6 +9,16 @@ from model.roots import Interface
 def addParameter(part, *args):
     """Add a Parameter feature to the Part and return Parameter.
 
+    .. function:: addParameter(part, variable, expression)
+
+    Args:
+        part (ModelAPI_Document): part document
+        variable (string): variable name
+        expression (string): Python expression
+
+    Returns:
+        Parameter: parameter object
+
     Pass all args to Parameter __init__ function.
     """
     assert(args)
@@ -19,11 +29,13 @@ def addParameter(part, *args):
 class Parameter(Interface):
     """Interface class for Parameter feature.
 
-    Parameter(feature) -> feature interface without initialization
-    Parameter(feature, variable, expression) ->
-        feature interface initialized from arguments:
-        - variable -- variable name
-        - expression -- Python expression
+    .. function:: Point(feature)
+
+        Create interface for the feature without initialization.
+
+    .. function:: Point(feature, variable, expression)
+
+        Create interface for the feature and initialize the feature with arguments.
     """
 
     def __init__(self, feature, *args):
@@ -31,8 +43,8 @@ class Parameter(Interface):
         Interface.__init__(self, feature)
         assert(self._feature.getKind() == "Parameter")
 
-        self._variable = self._feature.data().string("variable")
-        self._expression = self._feature.data().string("expression")
+        self._variable = self._feature.string("variable")
+        self._expression = self._feature.string("expression")
 
         assert(self._variable)
         assert(self._expression)
@@ -52,7 +64,7 @@ class Parameter(Interface):
 
         See __init__.
         """
-        self._fillAttribute(self._name, name)
+        self._fillAttribute(self._variable, name)
         pass
 
     def setExpression(self, expression):