]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add white list for redirect some missing attributes to the feature.
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 26 Oct 2015 07:33:08 +0000 (10:33 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 26 Oct 2015 07:33:29 +0000 (10:33 +0300)
src/PythonAPI/model/roots.py

index c2c70cbfab62258926db7ab7546dda6bad802c7a..b1e392855533b3c43950f6ad0042f9e876d11a60 100644 (file)
@@ -33,12 +33,15 @@ class Interface():
 
     def __init__(self, feature):
         self._feature = feature
+        self._attribute_white_list = [
+            "getKind",
+            ]
 
     def __getattr__(self, name):
         """Process missing attributes.
 
         Add get*() methods for access feature attributes.
-        Redirect missing attributes to the feature.
+        Redirect some missing attributes to the feature.
         """
         if name.startswith("get"):
             possible_names = [
@@ -51,7 +54,14 @@ class Interface():
                         return getattr(self, possible_name)
                     return getter
 
-        return self._feature.__getattribute__(name)
+        if name in self._attribute_white_list:
+            return getattr(self._feature, name)
+
+        return object.__getattribute__(self, name)
+
+    def feature(self):
+        """Return ModelAPI_Feature."""
+        return self._feature
 
     def setRealInput(self, inputid, value):
         self._feature.data().real(inputid).setValue(value)