]> SALOME platform Git repositories - modules/kernel.git/blobdiff - src/KERNEL_PY/kernel/parametric/study_exchange_vars.py
Salome HOME
updated copyright message
[modules/kernel.git] / src / KERNEL_PY / kernel / parametric / study_exchange_vars.py
index e30a33949d811b35fd308a1018fb2be7d30f060d..bebdc3b8a55051c0fe3323ea270668c2fd9862af 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2011-2023  CEA, EDF, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -50,8 +50,10 @@ class Variable:
     its name. Other attributes are reserved for future use.
     """
     
-    def __init__(self, name, dimension = [], minValue = None, maxValue = None,
+    def __init__(self, name, dimension = None, minValue = None, maxValue = None,
                  initialValue = None):
+        if dimension is None:
+            dimension = []
         self.name = name
         
         # Reserved for future use
@@ -100,8 +102,12 @@ class ExchangeVariables:
 
     """
     
-    def __init__(self, inputVarList = [], outputVarList = [],
+    def __init__(self, inputVarList = None, outputVarList = None,
                  refEntry = None):
+        if inputVarList is None:
+            inputVarList = []
+        if outputVarList is None:
+            outputVarList = []
         self.inputVarList = inputVarList
         self.outputVarList = outputVarList
         self.refEntry = refEntry
@@ -176,8 +182,7 @@ def createSObjectForExchangeVariables(fatherSobj, exchangeVariables,
     :return: the newly created SObject.
 
     """
-    studyId = fatherSobj.GetStudy()._get_StudyId()
-    editor = getStudyEditor(studyId)
+    editor = getStudyEditor()
     sobj = editor.createItem(fatherSobj,
                              name = name,
                              icon = icon,
@@ -204,8 +209,7 @@ def updateSObjectForExchangeVariables(sobj, exchangeVariables,
     other parameters.
 
     """
-    studyId = sobj.GetStudy()._get_StudyId()
-    editor = getStudyEditor(studyId)
+    editor = getStudyEditor()
     editor.setItem(sobj, name = name, icon = icon, typeId = typeId)
     editor.builder.RemoveAttribute(sobj, "AttributeParameter")
     _setSObjectForExchangeVariables(editor, sobj, exchangeVariables)