Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions osinfo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Script Name : osinfo.py
# Author : Craig Richards
# Created : 5th April 2012
# Last Modified : 22nd February 2016
# Last Modified : April 02 2016
# Version : 1.0

# Modifications : Changed the list to a dictionary. Although the order is lost, the info is with its label.
Expand All @@ -12,7 +12,7 @@

profile = {
'Architecture: ': platform.architecture(),
'Linux Distribution: ': platform.linux_distribution(),
#'Linux Distribution: ': platform.linux_distribution(),
'mac_ver: ': platform.mac_ver(),
'machine: ': platform.machine(),
'node: ': platform.node(),
Expand All @@ -27,5 +27,10 @@
'version: ': platform.version(),
}

if hasattr(platform, 'linux_distribution'):
#to avoid AttributeError exception in some old versions of the module
profile['linux_distribution'] = platform.linux_distribution()
#FIXME: do this for all properties but in a loop

for key in profile:
print(key + str(profile[key]))