From 9499aefd92138b08b488314e1524047212b9ef85 Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 24 Oct 2007 12:06:11 +0000 Subject: [PATCH] CCAR: change help to Help to be able to use pydoc inline help : now help(salome) displays pydoc documentation of salome.py module --- src/KERNEL_PY/Help.py | 6 ++--- src/KERNEL_PY/salome.py | 49 +++++++++++++++++++++++++++++++++++ src/KERNEL_PY/salome_iapp.py | 2 +- src/KERNEL_PY/salome_study.py | 3 +++ 4 files changed, 56 insertions(+), 4 deletions(-) diff --git a/src/KERNEL_PY/Help.py b/src/KERNEL_PY/Help.py index fcc1e84b2..c8ddfe0e0 100755 --- a/src/KERNEL_PY/Help.py +++ b/src/KERNEL_PY/Help.py @@ -37,7 +37,7 @@ MODULE : salome module salome gives access to Salome ressources: variables: - salome:orb : CORBA + salome.orb : CORBA salome.naming_service : instance of naming Service class methods: Resolve(name) : find a CORBA object (ior) by its pathname @@ -130,12 +130,12 @@ A new python example avoids references to LifeCycleCORBA -help = SalomeDoc(''' +Help = SalomeDoc(''' Availables modules: salome : gives access to Salome ressources geompy : encapsulation of GEOM Engine methods supervision : gives access to SuperVision Engine -To obtain specific help on a module "truc", type: help.truc() +To obtain specific help on a module "truc", type: Help.truc() To run an example, type: import example3 ''') diff --git a/src/KERNEL_PY/salome.py b/src/KERNEL_PY/salome.py index 956a767bd..7b44adbd6 100755 --- a/src/KERNEL_PY/salome.py +++ b/src/KERNEL_PY/salome.py @@ -23,11 +23,57 @@ # Author : Paul RASCLE, EDF # Module : SALOME # $Header$ +""" +Module salome gives access to Salome ressources. + +variables: + + salome.orb : CORBA + salome.naming_service : instance of naming Service class + methods: + Resolve(name) : find a CORBA object (ior) by its pathname + Register(name) : register a CORBA object under a pathname + salome.lcc : instance of lifeCycleCORBA class + methods: + FindOrLoadComponent(server,name) : + obtain an Engine (CORBA object) + or launch the Engine if not found, + with a Server name and an Engine name + salome.sg + methods: + updateObjBrowser(bool): + getActiveStudyId(): + getActiveStudyName(): + + SelectedCount(): returns number of selected objects + getSelected(i): returns entry of selected object number i + getAllSelected(): returns list of entry of selected objects + AddIObject(Entry): select an existing Interactive object + RemoveIObject(Entry): remove object from selection + ClearIObjects(): clear selection + + Display(*Entry): + DisplayOnly(Entry): + Erase(Entry): + DisplayAll(): + EraseAll(): + + IDToObject(Entry): returns CORBA reference from entry + + salome.myStudyName : active Study Name + salome.myStudyId : active Study Id + salome.myStudy : the active Study itself (CORBA ior) + methods : defined in SALOMEDS.idl + +""" from salome_kernel import * from salome_study import * from salome_iapp import * +orb, lcc, naming_service, cm,sg=None,None,None,None,None +myStudyManager, myStudyId, myStudy, myStudyName=None,None,None,None + salome_initial=1 def salome_init(theStudyId=0,embedded=0): """ @@ -77,3 +123,6 @@ def salome_init(theStudyId=0,embedded=0): ============================================ """ raise + +#to expose all objects to pydoc +__all__=dir() diff --git a/src/KERNEL_PY/salome_iapp.py b/src/KERNEL_PY/salome_iapp.py index 8265ab631..4cd5d7cee 100644 --- a/src/KERNEL_PY/salome_iapp.py +++ b/src/KERNEL_PY/salome_iapp.py @@ -62,7 +62,7 @@ def hasDesktop(): salome_iapp_initial = 1 -class SalomeOutsideGUI: +class SalomeOutsideGUI(object): """ Provides a replacement for class SalomeGUI outside GUI process. Do almost nothing diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index 468c93258..22b460dd6 100644 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -61,6 +61,9 @@ def DumpComponent(Study, SO, offset): #-------------------------------------------------------------------------- def DumpStudy(Study): + """ + Dump a study, given the ior + """ itcomp = Study.NewComponentIterator() while itcomp.More(): SC = itcomp.Value() -- 2.39.2