File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
# Script Name : osinfo.py
2
2
# Author : Craig Richards
3
3
# Created : 5th April 2012
4
- # Last Modified : 22nd February 2016
4
+ # Last Modified : April 02 2016
5
5
# Version : 1.0
6
6
7
7
# Modifications : Changed the list to a dictionary. Although the order is lost, the info is with its label.
12
12
13
13
profile = {
14
14
'Architecture: ' : platform .architecture (),
15
- 'Linux Distribution: ' : platform .linux_distribution (),
15
+ # 'Linux Distribution: ': platform.linux_distribution(),
16
16
'mac_ver: ' : platform .mac_ver (),
17
17
'machine: ' : platform .machine (),
18
18
'node: ' : platform .node (),
27
27
'version: ' : platform .version (),
28
28
}
29
29
30
+ if hasattr (platform , 'linux_distribution' ):
31
+ #to avoid AttributeError exception in some old versions of the module
32
+ profile ['linux_distribution' ] = platform .linux_distribution ()
33
+ #FIXME: do this for all properties but in a loop
34
+
30
35
for key in profile :
31
36
print (key + str (profile [key ]))
You can’t perform that action at this time.
0 commit comments