Message 56958 - Python tracker (original) (raw)
I joined a modified version of platform.py. Here is a summary of the modification:
- replaced '/etc' by global variable _etc_dir
- removed supported_dists parameter of dist()
- each element of dist() result is searched in the following places
(the first value found is kept):
- First line of /etc/-release
- Contents of /etc/lsb-release
- Extract from /etc/-release
I tested it on Mandriva 2007.1, Fedora 4 and on a faked /etc directory containing the Ubuntu files send by tiran. Results are: Mandriva 2007.1: ('MandrivaLinux', '2007.1', 'Official') Fedora 4: ('FedoraCore', '4', 'Stentz') Faked Ubuntu: ('Ubuntu', '7.10', 'gutsy')