Salome HOME
Merge 'master' branch into 'V9_dev' branch
[modules/kernel.git] / src / KERNEL_PY / __init__.py
index 31adec9dd9484877f43c0e6fd0e454e5217c53fc..9c78533a928ebd85c6d974dc7b957636d5e8f2bc 100755 (executable)
@@ -26,7 +26,7 @@
 #  Module : SALOME
 #
 """ 
-Module salome gives access to Salome ressources.
+Module salome gives access to Salome resources.
 
 variables:
 
@@ -68,7 +68,7 @@ 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)
@@ -106,13 +106,13 @@ MATCH_ENDING_PATTERN="site-packages" + os.path.sep + "salome"
 
 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)
@@ -167,7 +167,7 @@ myStudy, myStudyName=None,None
 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
@@ -190,19 +190,19 @@ def salome_init(embedded=0):
             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():
@@ -214,8 +214,6 @@ def salome_close():
         pass
     salome_initial=1
     salome_iapp_close()
-    salome_study_close()
-    myStudy, myStudyName=None,None
     pass