]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: change help to Help to be able to use pydoc inline help :
authorcaremoli <caremoli>
Wed, 24 Oct 2007 12:06:11 +0000 (12:06 +0000)
committercaremoli <caremoli>
Wed, 24 Oct 2007 12:06:11 +0000 (12:06 +0000)
now help(salome) displays pydoc documentation of salome.py module

src/KERNEL_PY/Help.py
src/KERNEL_PY/salome.py
src/KERNEL_PY/salome_iapp.py
src/KERNEL_PY/salome_study.py

index fcc1e84b26c4c243c8319cc3ebc8589c8c729692..c8ddfe0e01b632536077a7110de9cded3eeb634b 100755 (executable)
@@ -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
 ''')
   
index 956a767bd71cb85c1f4176cca3d8a4dd4d5c8f80..7b44adbd6240e98a76224d95d5a9f23bb6748634 100755 (executable)
 #  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()
index 8265ab631defeff9ce133c3702351b0fedfb24b0..4cd5d7ceea02d103e926cb42462ad4dd25656307 100644 (file)
@@ -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
index 468c93258336591b3d98902e2514a409cb62fd40..22b460dd651ec9f008d7f5f9e3c4ea71c31f888d 100644 (file)
@@ -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()