[Python-apps-team] Bug#595614: pykaraoke: assumes that non-Linux == OS X

Kelvin Lawson kelvinl at users.sf.net
Mon Sep 6 23:23:53 UTC 2010


Looking at the history it appears that these were part of an excellent user
contribution to add support for the GP2X platform. At the time of writing,
PyKaraoke officially supported the Linux, Windows and GP2X platforms, hence
the logic behind those tests. Since the tests were introduced four years ago
PyKaraoke has been found to work on at least two of the BSDs as well
(FreeBSD and NetBSD) which as you have identified will have been flagged as
OSX.

There is no real distinction needed between the currently working Unix-based
platforms (Linux, BSD and OSX) and they are generally used for UI tweaks.
The important distinctions are currently between Unix-based platforms,
Windows and GP2X. With that in mind a better test would probably be
something like:

if os.name == "posix":
    (uname, host, release, version, machine) = os.uname()
    if host == "gp2x":
        env = ENV_GP2X
    else:
        env = ENV_POSIX
else if os.name == "nt":
    env = ENV_WINDOWS
else:
    env = ENV_UNKNOWN

This would have the added benefit of removing the necessity to return to
this code to add additional uname responses in future such as for the
aforementioned Hurd and kFreeBSD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20100907/5ccf13ee/attachment.htm>


More information about the Python-apps-team mailing list