]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add _execute() to feature __init__() method.
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 30 Oct 2015 12:04:04 +0000 (15:04 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 30 Oct 2015 13:42:52 +0000 (16:42 +0300)
src/PythonAPI/model/features/extrusion.py
src/PythonAPI/model/roots.py

index d7aea072f77db082e2efcea9d051f74f99da55c3..2e0390813ba02ccd29cdbc4371e970fe6a0da5fd 100644 (file)
@@ -75,6 +75,8 @@ class Extrusion(Interface):
             self.setSizes(*args)
         elif len(args) == 1:
             self.setSize(args[0])
+
+        self._execute()
         pass
 
     def __clear(self):
index a5ac3c2014234874c733336619b588704301eca1..e3d794efab6ac512bf0d247555127684bfc29430 100644 (file)
@@ -34,6 +34,7 @@ class Interface():
     def __init__(self, feature):
         self._feature = feature
         self._attribute_white_list = [
+            "execute",
             "getKind", "results", "firstResult", "lastResult",
             ]
 
@@ -74,5 +75,10 @@ class Interface():
         validators = ModelAPI.ModelAPI_Session.get().validators()
         return validators.validate(self._feature)
 
-    def execute(self):
-        self._feature.execute()
+    def _execute(self):
+        if self.areInputValid():
+            self._feature.execute()
+        else:
+            raise RuntimeError("Can not execute %s: %s" %
+                               (self._feature.getKind(), self._feature.error())
+                               )