Salome HOME
Removed studyId in salome.kernel.varlist functions (now get it from SObject)
authorbarate <barate>
Fri, 11 Feb 2011 13:24:50 +0000 (13:24 +0000)
committerbarate <barate>
Fri, 11 Feb 2011 13:24:50 +0000 (13:24 +0000)
src/KERNEL_PY/kernel/varlist.py

index 64488066edf8849b7aba96c2bef8d260c73d6214..bad8e20680a4ec88c2a773e7c909838c53d37b46 100644 (file)
@@ -22,18 +22,19 @@ from studyedit import getStudyEditor
 DEFAULT_NAME = "Variables"
 
 def createVarListObj(fatherSobj, inputVarList = [], outputVarList = [],
-                     studyId = None, name = DEFAULT_NAME, icon = None,
-                     typeId = None):
+                     name = DEFAULT_NAME, icon = None, typeId = None):
+    studyId = fatherSobj.GetStudy()._get_StudyId()
     editor = getStudyEditor(studyId)
-    sObj = editor.createItem(fatherSobj,
+    sobj = editor.createItem(fatherSobj,
                              name = name,
                              icon = icon,
                              typeId = typeId)
-    attr = editor.builder.FindOrCreateAttribute(sObj, "AttributeParameter")
+    attr = editor.builder.FindOrCreateAttribute(sobj, "AttributeParameter")
     attr.SetStrArray("inputVarList", inputVarList)
     attr.SetStrArray("outputVarList", outputVarList)
 
-def getVarList(sobj, studyId = None):
+def getVarList(sobj):
+    studyId = sobj.GetStudy()._get_StudyId()
     editor = getStudyEditor(studyId)
     (found, attr) = editor.builder.FindAttribute(sobj, "AttributeParameter")
     if not found: