From d0142c4099edd930a130a5a0b56b748ca1315e38 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 6 Dec 2012 18:39:28 +0100 Subject: [PATCH] Changed persistence to avoid using Comment attribute --- src/salome/parametric/study.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/salome/parametric/study.py b/src/salome/parametric/study.py index 703f731..cdd3656 100644 --- a/src/salome/parametric/study.py +++ b/src/salome/parametric/study.py @@ -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 -- 2.39.2