X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPYHELLO%2FPYHELLO.py;h=9692c26a38de26857d3eee54338075c018fd03a1;hb=bb6886d6ebef016c3c7a86cc3ef6b32f128adade;hp=c5540f94e591c8f639146edbc22c048f2ea9403c;hpb=00270d695e8c6d211e3da128665593e15edb7db1;p=samples%2Fpyhello.git diff --git a/src/PYHELLO/PYHELLO.py b/src/PYHELLO/PYHELLO.py old mode 100755 new mode 100644 index c5540f9..9692c26 --- a/src/PYHELLO/PYHELLO.py +++ b/src/PYHELLO/PYHELLO.py @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -29,8 +29,7 @@ import PYHELLO_ORB__POA import SALOME_ComponentPy import SALOME_DriverPy import SALOMEDS - -from PYHELLO_utils import * +from PYHELLO_utils import findOrCreateComponent, objectID, moduleName, getStudy class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen, SALOME_ComponentPy.SALOME_ComponentPy_i, @@ -97,11 +96,11 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen, study = getStudy() father = study.FindComponent( moduleName() ) if father: - iter = study.NewChildIterator( father ) - while iter.More(): - name = iter.Value().GetName() + iterator = study.NewChildIterator(father) + while iterator.More(): + name = iterator.Value().GetName() if name: names.append( name ) - iter.Next() + iterator.Next() pass pass if names: @@ -110,12 +109,13 @@ class PYHELLO(PYHELLO_ORB__POA.PYHELLO_Gen, abuffer += [ "" ] abuffer += [ "pyhello = salome.lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ] abuffer += [ "" ] - abuffer += [ "pyhello.createObject( '%s' )" % name for name in names ] + abuffer += [ "pyhello.createObject( '%s')" % name for name in names ] abuffer += [ "" ] pass if isMultiFile: - abuffer = [ " " + s for s in abuffer ] - abuffer[0:0] = [ "def RebuildData():" ] - abuffer += [ " pass" ] + abuffer = [ " " + s for s in abuffer ] + abuffer[0:0] = [ "def RebuildData():" ] + abuffer += [ " pass" ] abuffer += [ "\0" ] - return ("\n".join( abuffer ), 1) + res = "\n".join( abuffer ) + return (res.encode(), 1)