Salome HOME
Fix compilation error on Linux. Part III.
[modules/shaper.git] / src / PythonAPI / model / roots.py
index 1fa83ee5715acdf3678cfd57e83543b126fb08e3..5f1c294bf13214e7acae6202a80d53cbca385f4e 100644 (file)
@@ -38,16 +38,11 @@ class Interface():
     def __init__(self, feature):
         """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
         self._feature = feature
-        self._attribute_white_list = [
-            "execute",
-            "getKind", "results", "firstResult", "lastResult",
-            ]
 
     def __getattr__(self, name):
         """Process missing attributes.
 
         Add get*() methods for access feature attributes.
-        Redirect some missing attributes to the feature.
         """
         if name.startswith("get"):
             possible_names = [
@@ -60,18 +55,31 @@ class Interface():
                         return getattr(self, possible_name)
                     return getter
 
-        if name in self._attribute_white_list:
-            return getattr(self._feature, name)
-
         raise AttributeError()
 
+    def _fillAttribute(self, attribute, value):
+        """Fill ModelAPI_Attribute* with value."""
+        tools.fill_attribute(attribute, value)
+
     def feature(self):
         """Return ModelAPI_Feature."""
         return self._feature
 
-    def _fill_attribute(self, attribute, value):
-        """Fill ModelAPI_Attribute* with value."""
-        tools.fill_attribute(attribute, value)
+    def getKind(self):
+        """Return the unique kind of the feature"""
+        return self._feature.getKind()
+
+    def results(self):
+        """Return current results of the feature"""
+        return self._feature.results()
+
+    def firstResult(self):
+        """Return the first result in the list of results"""
+        return self._feature.firstResult()
+
+    def lastResult(self):
+        """Return the last result in the list of results"""
+        return self._feature.lastResult()
 
     def setRealInput(self, inputid, value):
         """I.setRealInput(str, float) -- set real value to the attribute"""
@@ -82,8 +90,8 @@ class Interface():
         validators = ModelAPI.ModelAPI_Session.get().validators()
         return validators.validate(self._feature)
 
-    def _execute(self):
-        """I._execute() -- validate and execute the feature.
+    def execute(self):
+        """I.execute() -- validate and execute the feature.
 
         Raises RuntimeError if validation fails.
         """