Salome HOME
Add construction plugin without tests.
[modules/shaper.git] / src / PythonAPI / model / tools.py
index 71c2df66025c86f0d205118e8b8ec462d4b4ba45..eb6243e8214cb5d711c7c11c648dcd49ac4bb959 100644 (file)
@@ -48,22 +48,14 @@ class Selection:
         assert(len(args) > 1 and len(args) < 4)
         assert(isinstance(args[0], basestring) or
                isinstance(args[0], ModelAPI.ModelAPI_Result))
-#                 "args[0] should be str or ModelAPI_Result (%s given)." %
-#                 type(args[0]))
         if isinstance(args[0], basestring):
             assert(isinstance(args[1], basestring))
-#             ,
-#                    "args[1] should be str (%s given)." %
-#                    type(args[1]))
-        elif isinstance(args[0], ModelAPI.ModelAPI_Result):
+        elif isinstance(args[0], ModelAPI.ModelAPI_Result) or args[0] is None:
             assert(isinstance(args[1], GeomAPI.GeomAPI_Shape))
-#                    ,
-#                    "args[1] should be GeomAPI_Shape (%s given)." %
-#                    type(args[1]))
         self.args = args
 
 
-def fill_attribute(attribute, value, *args):
+def fill_attribute(attribute, value):
     """Set value to attribure.
 
     This function processes complex cases.
@@ -78,9 +70,6 @@ def fill_attribute(attribute, value, *args):
 
         assert(isinstance(value, collections.Iterable))
         for item in value:
-            attribute.append(item.result(), item.buildShape())
-            continue
-
             assert(isinstance(item, Selection))
             attribute.append(*item.args)
 
@@ -89,9 +78,6 @@ def fill_attribute(attribute, value, *args):
             attribute.setValue(None, None)
             return
 
-        attribute.setValue(value.result(), value.buildShape())
-        return
-
         assert(isinstance(value, Selection))
         attribute.setValue(*value.args)