]> SALOME platform Git repositories - modules/parametric.git/commitdiff
Salome HOME
Changed persistence to avoid using Comment attribute
authorRenaud Barate <renaud.barate@edf.fr>
Thu, 6 Dec 2012 17:39:28 +0000 (18:39 +0100)
committerRenaud Barate <renaud.barate@edf.fr>
Thu, 6 Dec 2012 17:39:28 +0000 (18:39 +0100)
src/salome/parametric/study.py

index 703f731679a083c1d2bdf5509cdf15bc2577f47d..cdd3656192865734c1370540d3f09790bf7b7170 100644 (file)
@@ -60,15 +60,19 @@ class ParametricStudyEditor:
   def _set_sobj(self, parametric_study, sobj):
     self.editor.setItem(sobj,
                         name = parametric_study.name,
-                        comment = cPickle.dumps(parametric_study),
                         icon = PARAM_STUDY_ICON,
                         typeId = PARAM_STUDY_TYPE_ID)
+    attr = self.editor.builder.FindOrCreateAttribute(sobj, "AttributeParameter")
+    attr.SetString("study", cPickle.dumps(parametric_study))
 
   def get_parametric_study(self, entry):
     sobj = self.editor.study.FindObjectID(entry)
     if sobj is None or self.editor.getTypeId(sobj) != PARAM_STUDY_TYPE_ID:
       raise Exception("No valid parametric study at entry %s" % entry)
-    param_study = cPickle.loads(sobj.GetComment())
+    found, attr = self.editor.builder.FindAttribute(sobj, "AttributeParameter")
+    if not found:
+      raise Exception("No valid parametric study at entry %s" % entry)
+    param_study = cPickle.loads(attr.GetString("study"))
     param_study.entry = entry
     return param_study