From: vsr Date: Wed, 15 Feb 2012 11:22:09 +0000 (+0000) Subject: Fix bug of Dump visual state functionality - IParameter should be cleared in the... X-Git-Tag: V6_5_0a1~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa6fea9bc8777fba8af8e23c036aafdb33c29689;p=modules%2Fkernel.git Fix bug of Dump visual state functionality - IParameter should be cleared in the script in order to prevent having its incorrect state when running Python script(s) in the same study. --- diff --git a/src/KERNEL_PY/iparameters.py b/src/KERNEL_PY/iparameters.py index dfa0df6ba..b82036cdd 100755 --- a/src/KERNEL_PY/iparameters.py +++ b/src/KERNEL_PY/iparameters.py @@ -76,13 +76,18 @@ class IParameters: Note: Methods not mentioned above are private and is not supposed to be used - by module's developers. + by module's developers. """ - def __init__(self, attributeParameter): - """Initializes the instance""" + def __init__(self, attributeParameter, clr=False): + """Initializes the instance. If clr parameter is True, all IAPP attribute values are cleared.""" self._ap = attributeParameter + if ( clr ): self.clear() pass + + def clear(self): + """Clear parameters""" + self._ap.Clear() def append(self, listName, value): """Appends a value to the named list""" diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx index 366f45469..9f6534ccf 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx @@ -293,7 +293,7 @@ std::string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, std::string dump(""); dump += "import iparameters\n"; - dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\""+anID+"\", 1))\n\n"; + dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\""+anID+"\", 1), True)\n\n"; std::vector v = ip.getProperties();