swc-installation-test-2.py: Add OS-version detection
Using assorted functions from the `platform` module. On my Linux box:
$ python2.7
Python 2.7.3 (default, Dec 5 2012, 10:56:01)
[GCC 4.5.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('Gentoo Base System', '2.1', '')
>>> platform.mac_ver()
('', ('', '', ''), '')
>>> platform.win32_ver()
('', '', '', '')
On an OS X box:
$ python2.6
Python 2.6.1 (r261:67515, Aug 2 2010, 20:10:18)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('', '', '')
>>> platform.mac_ver()
('10.6.8', ('', '', ''), 'i386')
>>> platform.win32_ver()
('', '', '', '')
I don't have access to an MS Windows box, but presumably it returns
something like:
>>> platform.linux_distribution()
('', '', '')
>>> platform.mac_ver()
('', ('', '', ''), '')
>>> platform.win32_ver()
('XP', '5.1.2600', 'SP2', 'Multiprocessor Free')
We only want to print the one that applies (e.g. don't print a
'linux_distribution' entry on OS X), so we skip entries where value[0]
is an empty string.