X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKERNEL_PY%2FPyInterp.py;h=f1d1ac4918e2ff0a5647b8c8e8f41b890dfb74d6;hb=513b8629ac55467ab7f604cd1733b542f7e9a40a;hp=8e4595e65af18cf46bae799182d3ae78b9ff1cc7;hpb=e61c3f5e439eae3822cb22176c5493668e5a7df5;p=modules%2Fkernel.git diff --git a/src/KERNEL_PY/PyInterp.py b/src/KERNEL_PY/PyInterp.py old mode 100755 new mode 100644 index 8e4595e65..f1d1ac491 --- a/src/KERNEL_PY/PyInterp.py +++ b/src/KERNEL_PY/PyInterp.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2021 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 @@ -35,9 +35,10 @@ from SALOME_NamingServicePy import * #-------------------------------------------------------------------------- -def DumpComponent(Study, SO, offset): - it = Study.NewChildIterator(SO) - Builder = Study.NewBuilder() +def DumpComponent(SO, offset): + global myStudy + it = myStudy.NewChildIterator(SO) + Builder = myStudy.NewBuilder() while it.More(): CSO = it.Value() it.Next() @@ -50,7 +51,7 @@ def DumpComponent(Study, SO, offset): while ofs <= offset: a = a + "--" ofs = ofs +1 - print a + ">" + CSO.GetID() + " " + t_name[1] + print(a + ">" + CSO.GetID() + " " + t_name[1]) t_RefSO = CSO.ReferencedObject() if t_RefSO[0] == 1: RefSO = t_RefSO[1] @@ -59,19 +60,20 @@ def DumpComponent(Study, SO, offset): while ofs <= offset: a = a + " " ofs = ofs +1 - print a + ">" + RefSO.GetID() - DumpComponent(Study, CSO, offset+2) + print(a + ">" + RefSO.GetID()) + DumpComponent(CSO, offset+2) #-------------------------------------------------------------------------- -def DumpStudy(Study): - itcomp = Study.NewComponentIterator() +def DumpStudy(): + global myStudy + itcomp = myStudy.NewComponentIterator() while itcomp.More(): SC = itcomp.Value() itcomp.Next() name = SC.ComponentDataType() - print "-> ComponentDataType is " + name - DumpComponent(Study, SC, 1) + print("-> ComponentDataType is " + name) + DumpComponent(SC, 1) #-------------------------------------------------------------------------- @@ -90,8 +92,8 @@ naming_service = SALOME_NamingServicePy_i(orb) # get active study name myStudyName = sg.getStudyName() -print myStudyName +print(myStudyName) # get Study reference -obj = naming_service.Resolve('Study') +obj = naming_service.Resolve('/Study') myStudy = obj._narrow(SALOMEDS.Study)