]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[PythonAPI] Improve tools.fill_attribute() for ModelAPI_AttributeString
authorspo <sergey.pokhodenko@opencascade.com>
Wed, 16 Dec 2015 09:37:25 +0000 (12:37 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:08 +0000 (14:53 +0300)
src/PythonAPI/model/tools.py

index a9357d7c8c1764d736333bd349ff2c1a05712bf7..36726317a9d52a52134f5db8b0f939ceb98a1bd4 100644 (file)
@@ -63,11 +63,13 @@ def fill_attribute(attribute, value):
     if (isinstance(attribute, ModelAPI.ModelAPI_AttributeBoolean) or
         isinstance(attribute, ModelAPI.ModelAPI_AttributeDocRef) or
         isinstance(attribute, ModelAPI.ModelAPI_AttributeInteger) or
-        isinstance(attribute, ModelAPI.ModelAPI_AttributeReference) or
-        isinstance(attribute, ModelAPI.ModelAPI_AttributeString)
+        isinstance(attribute, ModelAPI.ModelAPI_AttributeReference)
         ):
         attribute.setValue(value)
 
+    elif isinstance(attribute, ModelAPI.ModelAPI_AttributeString):
+        attribute.setValue(str(value))
+
     elif isinstance(attribute, ModelAPI.ModelAPI_AttributeDouble):
         if isinstance(value, basestring):
             attribute.setText(value)