Salome HOME
Removed parameter "theStudy" in "DumpPython"
authorimn <imn@opencascade.com>
Tue, 29 Nov 2016 13:37:35 +0000 (16:37 +0300)
committerimn <imn@opencascade.com>
Tue, 29 Nov 2016 13:37:35 +0000 (16:37 +0300)
src/PYHELLO/PYHELLO.py

index 03757668700ad0b0a30de14a2952412c8918c366..f6b7caa01692743a496d09b5ee8914bd499ea123 100644 (file)
@@ -90,9 +90,10 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen,
     """
     Dump module data to the Python script.
     """
-    def DumpPython( self, study, isPublished, isMultiFile ):
+    def DumpPython( self, isPublished, isMultiFile ):
         abuffer = []
         names = []
+        study = self._naming_service.Resolve("/Study")
         father = study.FindComponent( moduleName() )
         if father:
             iter = study.NewChildIterator( father )
@@ -103,17 +104,17 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen,
                 pass
             pass
         if names:
-            abuffer += [ "from salome import lcc" ]
+            abuffer += [ "import salome" ]
             abuffer += [ "import PYHELLO_ORB" ]
             abuffer += [ "" ]
-            abuffer += [ "pyhello = lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ]
+            abuffer += [ "pyhello = salome.lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ]
             abuffer += [ "" ]
-            abuffer += [ "pyhello.createObject( theStudy, '%s' )" % name for name in names ]
+            abuffer += [ "pyhello.createObject( salome.myStudy, '%s' )" % name for name in names ]
             abuffer += [ "" ]
             pass
         if isMultiFile:
             abuffer       = [ "  " + s for s in abuffer ]
-            abuffer[0:0]  = [ "def RebuildData( theStudy ):" ]
+            abuffer[0:0]  = [ "def RebuildData():" ]
             abuffer      += [ "  pass" ]
         abuffer += [ "\0" ]
         return ("\n".join( abuffer ), 1)