if IN_SALOME_GUI:
libName = "lib" + ComponentName + "_Swig"
command = "from " + libName + " import *"
- exec ( command )
+ exec (command, globals())
constructor = ComponentName + "_Swig()"
command = "gui = " + constructor
- exec ( command )
- return gui
+ exec (command, globals())
+ return gui # @UndefinedVariable
else:
- print "Warning: ImportComponentGUI(",ComponentName,") outside GUI !"
- print "calls to GUI methods may crash..."
+ print("Warning: ImportComponentGUI(",ComponentName,") outside GUI !")
+ print("calls to GUI methods may crash...")
return salome_ComponentGUI
#--------------------------------------------------------------------------
Provides a replacement for class SalomeGUI outside GUI process.
Do almost nothing
"""
- global myStudyId, myStudyName
+ global myStudyName
def hasDesktop(self):
"""Indicate if GUI is running"""
return False
- def updateObjBrowser(self, bid):
+ def updateObjBrowser(self):
"""update the GUI object browser"""
- print "SalomeOutsideGUI: no objectBrowser update outside GUI"
+ print("SalomeOutsideGUI: no objectBrowser update outside GUI")
pass
- def getActiveStudyId(self):
- """Get the active study id"""
- print "SalomeOutsideGUI.getActiveStudyId: avoid use outside GUI"
- return myStudyId
-
- def getActiveStudyName(self):
- """Get the active study name"""
- print "SalomeOutsideGUI.getActiveStudyName: avoid use outside GUI"
+ def getStudyName(self):
+ """Get the study name"""
+ print("SalomeOutsideGUI.getStudyName: avoid use outside GUI")
return myStudyName
def SelectedCount(self):
"""Get the number of active selections"""
- print "SalomeOutsideGUI: no selection mechanism available outside GUI"
+ print("SalomeOutsideGUI: no selection mechanism available outside GUI")
return 0
def getSelected(self, i):
"""Get the selection number i """
- print "SalomeOutsideGUI: no selection mechanism available outside GUI"
+ print("SalomeOutsideGUI: no selection mechanism available outside GUI")
return none
def AddIObject(self, Entry):
"""Add an entry"""
- print "SalomeOutsideGUI.AddIOObject: not available outside GUI"
+ print("SalomeOutsideGUI.AddIOObject: not available outside GUI")
pass
def RemoveIObject(self, Entry):
"""Remove an entry"""
- print "SalomeOutsideGUI.REmoveIOObject: not available outside GUI"
+ print("SalomeOutsideGUI.REmoveIOObject: not available outside GUI")
pass
def ClearIObjects(self):
"""Clear entries"""
- print "SalomeOutsideGUI.ClearIOObject: not available outside GUI"
+ print("SalomeOutsideGUI.ClearIOObject: not available outside GUI")
pass
def Display(self, Entry):
"""Display an entry"""
- print "SalomeOutsideGUI.Display: not available outside GUI"
+ print("SalomeOutsideGUI.Display: not available outside GUI")
pass
def DisplayOnly(self, Entry):
"""Display only an entry"""
- print "SalomeOutsideGUI.DisplayOnly: not available outside GUI"
+ print("SalomeOutsideGUI.DisplayOnly: not available outside GUI")
pass
def Erase(self, Entry):
"""Erase en entry"""
- print "SalomeOutsideGUI.Erase: not available outside GUI"
+ print("SalomeOutsideGUI.Erase: not available outside GUI")
pass
def DisplayAll(self):
"""Display all"""
- print "SalomeOutsideGUI.Erase: not available outside GUI"
+ print("SalomeOutsideGUI.Erase: not available outside GUI")
pass
def EraseAll(self):
"""Erase all"""
- print "SalomeOutsideGUI.EraseAll: not available outside GUI"
+ print("SalomeOutsideGUI.EraseAll: not available outside GUI")
pass
def IsInCurrentView(self, Entry):
"""Indicate if an entry is in current view"""
- print "SalomeOutsideGUI.IsIncurrentView: not available outside GUI"
+ print("SalomeOutsideGUI.IsIncurrentView: not available outside GUI")
return False
def getComponentName(self, ComponentUserName ):
"""Get component name from component user name"""
- print "SalomeOutsideGUI.getComponentName: not available outside GUI"
+ print("SalomeOutsideGUI.getComponentName: not available outside GUI")
return ""
def getComponentUserName( self, ComponentName ):
"""Get component user name from component name"""
- print "SalomeOutsideGUI.getComponentUserName: not available outside GUI"
+ print("SalomeOutsideGUI.getComponentUserName: not available outside GUI")
return ""
#--------------------------------------------------------------------------