# Module : SALOME
#
"""
-Module salome gives access to Salome ressources.
+Module salome gives access to Salome resources.
variables:
"""
## @package salome
-# Module salome gives access to Salome ressources.
+# Module salome gives access to Salome resources.
#
# \param salome.orb : CORBA orb object
# \param salome.naming_service : instance of naming Service class (SALOME_NamingServicePy::SALOME_NamingServicePy_i)
def extend_path(pname):
for dir in sys.path:
- if not isinstance(dir, basestring) or not os.path.isdir(dir) or not dir.endswith(MATCH_ENDING_PATTERN):
+ if not isinstance(dir, str) or not os.path.isdir(dir) or not dir.endswith(MATCH_ENDING_PATTERN):
continue
subdir = os.path.join(dir, pname)
# XXX This may still add duplicate entries to path on
# case-insensitive filesystems
if os.path.isdir(subdir) and subdir not in __path__:
- if verbose(): print "INFO - The directory %s is appended to sys.path" % subdir
+ if verbose(): print("INFO - The directory %s is appended to sys.path" % subdir)
__path__.append(subdir)
extend_path(ROOT_PYTHONPACKAGE_NAME)
salome_initial=1
def salome_init(embedded=0):
"""
- Performs only once SALOME general purpose intialisation for scripts.
+ Performs only once SALOME general purpose initialisation for scripts.
Provides:
orb reference to CORBA
lcc a LifeCycleCorba instance
myStudy, myStudyName = salome_study_init()
pass
pass
- except RuntimeError, inst:
+ except RuntimeError as inst:
# wait a little to avoid trace mix
import time
time.sleep(0.2)
x = inst
- print "salome.salome_init():", x
- print """
+ print("salome.salome_init():", x)
+ print("""
============================================
May be there is no running SALOME session
- salome.salome_init() is intented to be used
+ salome.salome_init() is intended to be used
within an already running session
============================================
- """
+ """)
raise
def salome_close():
pass
salome_initial=1
salome_iapp_close()
- salome_study_close()
- myStudy, myStudyName=None,None
pass