X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FPYHELLO%2FPYHELLO_utils.py;h=e140a5deadba48e54779d86f0b3d1d92d165dac7;hb=bb6886d6ebef016c3c7a86cc3ef6b32f128adade;hp=0e5d6ebe8c1ca88a628a88a5ff6b489e02285d49;hpb=f03c07ab80a4bdce07d6adb5ed18379ed91ecd3d;p=samples%2Fpyhello.git diff --git a/src/PYHELLO/PYHELLO_utils.py b/src/PYHELLO/PYHELLO_utils.py index 0e5d6eb..e140a5d 100644 --- a/src/PYHELLO/PYHELLO_utils.py +++ b/src/PYHELLO/PYHELLO_utils.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 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -32,13 +32,14 @@ __all__ = [ "getORB", "getNS", "getLCC", - "getStudy", "getEngine", + "getStudy", "getEngineIOR", "findOrCreateComponent", "getObjectID", ] + from omniORB import CORBA from SALOME_NamingServicePy import SALOME_NamingServicePy_i from LifeCycleCORBA import LifeCycleCORBA @@ -164,8 +165,9 @@ def getEngineIOR(): ### # Find or create PYHELLO component object in a study ### -def findOrCreateComponent( study ): - father = study.FindComponent( moduleName() ) +def findOrCreateComponent(): + study = getStudy() + father =study.FindComponent( moduleName() ) if father is None: builder = study.NewBuilder() father = builder.NewComponent( moduleName() ) @@ -186,9 +188,10 @@ def findOrCreateComponent( study ): ### # Get object's ID ### -def getObjectID( study, entry ): +def getObjectID( entry ): ID = unknownID() - if study and entry: + study = getStudy() + if entry: sobj = study.FindObjectID( entry ) if sobj is not None: test, anAttr = sobj.FindAttribute( "AttributeLocalID" )