From: imn Date: Mon, 28 Nov 2016 14:35:53 +0000 (+0300) Subject: Fixed problem with dump study and remove parameter "theStudy" in python function... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5ea1135dda6434d73c48a5959678051a81abe7c2;p=modules%2Fgeom.git Fixed problem with dump study and remove parameter "theStudy" in python function "RebuildData()" --- diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index abcd110d6..de65b60d4 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -588,18 +588,21 @@ TCollection_AsciiString GEOM_Engine::DumpPython(std::vector& theObj { TCollection_AsciiString anEmptyScript; if( isMultiFile ) - anEmptyScript = "def RebuildData(theStudy): pass\n"; + anEmptyScript = "def RebuildData(): pass\n"; return anEmptyScript; } + + if( isMultiFile ) + aScript = "import salome\n"; - aScript = "import GEOM\n"; + aScript += "import GEOM\n"; aScript += "from salome.geom import geomBuilder\n"; aScript += "import math\n"; aScript += "import SALOMEDS\n\n"; if( isMultiFile ) - aScript += "def RebuildData(theStudy):"; + aScript += "def RebuildData():"; - aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n"; + aScript += "\n\tgeompy = geomBuilder.New(salome.myStudy)\n"; AddTextures(aScript); diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 0aad1be10..69bbe46b0 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -831,12 +831,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): ## Dump component to the Python script # This method overrides IDL function to allow default values for the parameters. - def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True): + def DumpPython(self, theIsPublished=True, theIsMultiFile=True): """ Dump component to the Python script This method overrides IDL function to allow default values for the parameters. """ - return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile) + return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile) ## Get name for sub-shape aSubObj of shape aMainObj #