X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPYHELLO%2FPYHELLO.py;fp=src%2FPYHELLO%2FPYHELLO.py;h=b9592b9f503048fdb43aff48ce29223258a583b9;hb=0de2d7864ad360606be75fb913d7e5367466b29f;hp=2d3ada4c7a1a5ddb7bea13e0bf673a21b3074507;hpb=0c0c5f4f03f4df60eef5f82756a9fbe7cfe396a8;p=samples%2Fpyhello.git diff --git a/src/PYHELLO/PYHELLO.py b/src/PYHELLO/PYHELLO.py index 2d3ada4..b9592b9 100644 --- a/src/PYHELLO/PYHELLO.py +++ b/src/PYHELLO/PYHELLO.py @@ -84,9 +84,8 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen, """ Dump module data to the Python script. """ - def DumpPython( self, study, isPublished ): + def DumpPython( self, study, isPublished, isMultiFile ): abuffer = [] - abuffer.append( "def RebuildData( theStudy ):" ) names = [] father = study.FindComponent( moduleName() ) if father: @@ -98,16 +97,19 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen, pass pass if names: - abuffer += [ " from batchmode_salome import lcc" ] - abuffer += [ " import PYHELLO_ORB" ] - abuffer += [ " " ] - abuffer += [ " pyhello = lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ] - abuffer += [ " " ] - abuffer += [ " pyhello.createObject( theStudy, '%s' )" % name for name in names ] + abuffer += [ "from salome import lcc" ] + abuffer += [ "import PYHELLO_ORB" ] + abuffer += [ "" ] + abuffer += [ "pyhello = lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ] + abuffer += [ "" ] + abuffer += [ "pyhello.createObject( theStudy, '%s' )" % name for name in names ] + abuffer += [ "" ] pass - abuffer += [ " " ] - abuffer.append( " pass" ) - abuffer.append( "\0" ) + if isMultiFile: + abuffer = [ " " + s for s in abuffer ] + abuffer[0:0] = [ "def RebuildData( theStudy ):" ] + abuffer += [ " pass" ] + abuffer += [ "\0" ] return ("\n".join( abuffer ), 1) """