From 4697508c640571cb8b5f4ce6772f4a28c94f5b6f Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sat, 15 Dec 2018 09:19:59 +0100 Subject: [PATCH] Adding details on platform information --- src/daComposant/daCore/PlatformInfo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/daComposant/daCore/PlatformInfo.py b/src/daComposant/daCore/PlatformInfo.py index e0d5087..51f6f5f 100644 --- a/src/daComposant/daCore/PlatformInfo.py +++ b/src/daComposant/daCore/PlatformInfo.py @@ -85,12 +85,26 @@ class PlatformInfo(object): __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 len(platform.processor())>0: + __msg += "\n%s%30s : %s" %(__prefix,"platform.processor",platform.processor()) + # 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 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'} + 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]+")")) + 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]) # @@ -100,6 +114,9 @@ class PlatformInfo(object): __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())) + __msg += "\n" + __msg += "\n%s%30s : %s" %(__prefix,"platform.node",platform.node()) + __msg += "\n%s%30s : %s" %(__prefix,"os.path.expanduser",os.path.expanduser('~')) return __msg def getPythonVersion(self): -- 2.39.2