]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix tests
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 20 Jun 2016 10:45:43 +0000 (13:45 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 20 Jun 2016 10:45:43 +0000 (13:45 +0300)
src/PythonAPI/extension/box.py
src/PythonAPI/model/roots.py

index c3ef9dcbcbe2c40af7f8dde370f332db0d104108..9d4d66ce9822695874efedcfdbc0d093cf513dca 100644 (file)
@@ -52,15 +52,15 @@ class Box(Interface):
 
     def setWidth(self, width):
         """B.setWidth(float) -- modify width attribute"""
-        self._fillAttribute(self._width, width)
+        self._width.setValue(width)
         pass
 
     def setLength(self, length):
         """B.setLength(float) -- modify length attribute"""
-        self._fillAttribute(self._length, length)
+        self._length.setValue(length)
         pass
 
     def setHeight(self, height):
         """B.setHeight(float) -- modify height attribute"""
-        self._fillAttribute(self._height, height)
+        self._height.setValue(height)
         pass
index 2ba6a21de90d1583bbfd11b20e6c39a8ffc3418b..77a2335ce0274578c858d439174a96ce3340f986 100644 (file)
@@ -5,9 +5,6 @@ Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
 import ModelAPI
 
-from model import tools
-
-
 class Feature(ModelAPI.ModelAPI_Feature):
     """Base class of user-defined Python features."""
 
@@ -43,28 +40,6 @@ class Interface():
         """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
         self._feature = feature
 
-    def __getattr__(self, name):
-        """Process missing attributes.
-
-        Add get*() methods for access feature attributes.
-        """
-        if name.startswith("get"):
-            possible_names = [
-                "_" + name[3:],
-                "_" + tools.convert_to_underscore(name[3:]),
-                ]
-            for possible_name in possible_names:
-                if hasattr(self, possible_name):
-                    def getter():
-                        return getattr(self, possible_name)
-                    return getter
-
-        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