Salome HOME
Code improvements for warning on iteration control
[modules/adao.git] / src / daComposant / daCore / PlatformInfo.py
index f23b2a217004ab7f0c73a2149de3db5b449975e1..013cc0c0e5803aa5c53d499f4fe8700b57852103 100644 (file)
@@ -98,13 +98,18 @@ class PlatformInfo(object):
                 __msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
         elif sys.platform.startswith('darwin'):
             if hasattr(platform, 'mac_ver'):
-                __macosxv = {'5': 'Leopard',       '6': 'Snow Leopard', '7': 'Lion',
-                             '8': 'Mountain Lion', '9': 'Mavericks',   '10': 'Yosemite',
-                             '11': 'El Capitan',  '12': 'Sierra'}
+                __macosxv = {
+                     '0': 'Cheetah',       '1': 'Puma',         '2': 'Jaguar',
+                     '3': 'Panther',       '4': 'Tiger',        '5': 'Leopard',
+                     '6': 'Snow Leopard',  '7': 'Lion',         '8': 'Mountain Lion',
+                     '9': 'Mavericks',    '10': 'Yosemite',    '11': 'El Capitan',
+                    '12': 'Sierra',       '13': 'High Sierra', '14': 'Mojave',
+                    '15': 'Catalina',     '16': 'Big Sur',     '17': 'Monterey',
+                    }
                 for key in __macosxv:
                     if (platform.mac_ver()[0].split('.')[1] == key):
                         __msg += "\n%s%30s : %s" %(__prefix,
-                            "platform.mac_ver",str(platform.mac_ver()[0]+"(" + macosx_dict[key]+")"))
+                            "platform.mac_ver",str(platform.mac_ver()[0]+"(" + __macosxv[key]+")"))
             elif hasattr(platform, 'dist'):
                 __msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
         elif os.name == 'nt':
@@ -317,7 +322,7 @@ def strmatrix2liststr( __strvect ):
     __strvect = __strvect.replace(","," ") # Blanc
     for s in ("]", ")"):
         __strvect = __strvect.replace(s,";") # "]" et ")" par ";"
-    __strvect = re.sub(';\s*;',';',__strvect)
+    __strvect = re.sub(r';\s*;',r';',__strvect)
     __strvect = __strvect.rstrip(";") # Après ^ et avant v
     __strmat = [l.split() for l in __strvect.split(";")]
     return __strmat
@@ -368,7 +373,7 @@ class PathManagement(object):
         self.__paths["daNumerics"]  = os.path.join(parent,"daNumerics")
         #
         for v in self.__paths.values():
-            sys.path.insert(0, v )
+            if os.path.isdir(v): sys.path.insert(0, v )
         #
         # Conserve en unique exemplaire chaque chemin
         sys.path = uniq( sys.path )