Back to index

salome-kernel  6.5.0
Classes | Functions | Variables
KERNEL_PY.kernel.studyedit Namespace Reference

Classes

class  StudyEditor

Functions

def getActiveStudyId
def getActiveStudy
def getStudyFromStudyId
def getStudyIdFromStudy
def getStudyEditor

Variables

tuple logger = Logger("salome.kernel.studyedit", color = termcolor.PURPLE)
dictionary _editors = {}
string _DEFAULT_CONTAINER = "FactoryServer"

Function Documentation

Definition at line 51 of file studyedit.py.

Here is the call graph for this function:

Return the ID of the active study. In GUI mode, this function is equivalent
to ``salome.sg.getActiveStudyId()``. Outside GUI, it returns
``salome.myStudyId`` variable.

Definition at line 36 of file studyedit.py.

00036 
00037 def getActiveStudyId():
00038     """
00039     Return the ID of the active study. In GUI mode, this function is equivalent
00040     to ``salome.sg.getActiveStudyId()``. Outside GUI, it returns
00041     ``salome.myStudyId`` variable.
00042     """
00043     salome.salome_init()
00044     # Warning: we don't use salome.getActiveStudy() here because it doesn't
00045     # work properly when called from Salome modules (multi-study interpreter
00046     # issue)
00047     if salome.hasDesktop():
00048         return salome.sg.getActiveStudyId()
00049     else:
00050         return salome.myStudyId

Here is the caller graph for this function:

Return a :class:`StudyEditor` instance to edit the study with ID
`studyId`. If `studyId` is :const:`None`, return an editor for the current
study.

Definition at line 63 of file studyedit.py.

00063 
00064 def getStudyEditor(studyId = None):
00065     """
00066     Return a :class:`StudyEditor` instance to edit the study with ID
00067     `studyId`. If `studyId` is :const:`None`, return an editor for the current
00068     study.
00069     """
00070     if studyId is None:
00071         studyId = getActiveStudyId()
00072     if not _editors.has_key(studyId):
00073         _editors[studyId] = StudyEditor(studyId)
00074     return _editors[studyId]

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file studyedit.py.

00054 
00055 def getStudyFromStudyId(studyId):
00056     salome.salome_init()
00057     study = salome.myStudyManager.GetStudyByID(studyId)
00058     return study

Here is the caller graph for this function:

Definition at line 59 of file studyedit.py.

00059 
00060 def getStudyIdFromStudy(study):
00061     studyId = study._get_StudyId()
00062     return studyId


Variable Documentation

Definition at line 34 of file studyedit.py.

Definition at line 33 of file studyedit.py.

tuple KERNEL_PY.kernel.studyedit.logger = Logger("salome.kernel.studyedit", color = termcolor.PURPLE)

Definition at line 31 of file studyedit.py.