From: Renaud Barate Date: Thu, 6 Dec 2012 17:39:28 +0000 (+0100) Subject: Changed persistence to avoid using Comment attribute X-Git-Tag: V6_6_0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d0142c4099edd930a130a5a0b56b748ca1315e38;p=modules%2Fparametric.git Changed persistence to avoid using Comment attribute --- 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