From beadf5e4c50ffe25053b705a254b42c25d340fd7 Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 16 Dec 2015 12:37:25 +0300 Subject: [PATCH] [PythonAPI] Improve tools.fill_attribute() for ModelAPI_AttributeString --- src/PythonAPI/model/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PythonAPI/model/tools.py b/src/PythonAPI/model/tools.py index a9357d7c8..36726317a 100644 --- a/src/PythonAPI/model/tools.py +++ b/src/PythonAPI/model/tools.py @@ -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) -- 2.39.2