]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Increase platform information
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Tue, 11 Dec 2018 19:17:10 +0000 (20:17 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Tue, 11 Dec 2018 19:17:10 +0000 (20:17 +0100)
src/daComposant/daCore/ExtendedLogging.py
src/daComposant/daCore/PlatformInfo.py

index c38b7a00466ae4db0baa06975a164b2acdfb97d1..d82fa1d2e3a02fcce56efdac593983815a9baee1 100644 (file)
@@ -115,9 +115,9 @@ class ExtendedLogging(object):
         logging.info( "- Sphinx.......: "+str(PlatformInfo.has_sphinx) )
         logging.info( "- Nlopt........: "+str(PlatformInfo.has_nlopt) )
         logging.info( "Library versions:" )
-        logging.info( "- Python.......:"+p.getPythonVersion() )
-        logging.info( "- Numpy........:"+p.getNumpyVersion() )
-        logging.info( "- Scipy........:"+p.getScipyVersion() )
+        logging.info( "- Python.......: "+p.getPythonVersion() )
+        logging.info( "- Numpy........: "+p.getNumpyVersion() )
+        logging.info( "- Scipy........: "+p.getScipyVersion() )
         logging.info( "" )
 
     def setLogfile(self, filename=LOGFILE, filemode="w", level=logging.NOTSET):
index 3c6ac2704865d6352e5ace54778faa6f4f5c7b97..e0d5087637c48cc025f98d99a6a3ed55c841fbf7 100644 (file)
@@ -46,6 +46,8 @@ __all__ = []
 
 import os
 import sys
+import platform
+import locale
 
 # ==============================================================================
 class PlatformInfo(object):
@@ -76,6 +78,30 @@ class PlatformInfo(object):
         import daCore.version as dav
         return dav.year
 
+    def getSystemInformation(self, __prefix=""):
+        __msg  = ""
+        __msg += "\n%s%30s : %s" %(__prefix,"platform.system",platform.system())
+        __msg += "\n%s%30s : %s" %(__prefix,"sys.platform",sys.platform)
+        __msg += "\n%s%30s : %s" %(__prefix,"platform.version",platform.version())
+        __msg += "\n%s%30s : %s" %(__prefix,"platform.platform",platform.platform())
+        __msg += "\n%s%30s : %s" %(__prefix,"platform.machine",platform.machine())
+        if sys.platform.startswith('linux'):
+            if hasattr(platform, 'linux_distribution'):
+                __msg += "\n%s%30s : %s" %(__prefix,
+                    "platform.linux_distribution",str(platform.linux_distribution()))
+            else:
+                __msg += "\n%s%30s : %s" %(__prefix,"platform.dist",str(platform.dist()))
+        elif os.name == 'nt':
+            __msg += "\n%s%30s : %s" %(__prefix,"platform.win32_ver",platform.win32_ver()[1])
+        #
+        __msg += "\n"
+        __msg += "\n%s%30s : %s" %(__prefix,"platform.python_implementation",platform.python_implementation())
+        __msg += "\n%s%30s : %s" %(__prefix,"sys.executable",sys.executable)
+        __msg += "\n%s%30s : %s" %(__prefix,"sys.version",sys.version.replace('\n',''))
+        __msg += "\n%s%30s : %s" %(__prefix,"sys.getfilesystemencoding",str(sys.getfilesystemencoding()))
+        __msg += "\n%s%30s : %s" %(__prefix,"locale.getdefaultlocale",str(locale.getdefaultlocale()))
+        return __msg
+
     def getPythonVersion(self):
         "Retourne la version de python disponible"
         return ".".join([str(x) for x in sys.version_info[0:3]]) # map(str,sys.version_info[0:3]))