On Sat, 17 Oct 2009 18:19:44 +0200, Tarek Ziadé <[email protected]> wrote: > If you can find a way to express conditions based on os.environ, > maybe os.environ could be added to the variables that are used > when checking the markers on a given platform.
I'm not sure that you should try to do that. It would make things too complicated for the developer. I'm not sure that they would like to guess environment variables at an end-users system. It's different if the api does it internally. The developer then doesn't see how the check for kde or gnome is actually performed. > e.g. like = 'KDEDIR' in os.environ (so meaning we introduce sequence > comparisons/operators > in those markers) I suggest that you just add a variable for 'desktop' or something to your pep and allow them to check for that. I've told you an easy way to check (environment variables) so there's no reason you couldn't do it the same way. > Do you have an example for a platform that would depend on a > configuration file ? What I meant there was that desktops such as gnome or kde or flux or others can also be detected internally by the presence of their configuration files on linux. http://www.ibiblio.org/oswg/oswg-nightly/oswg/en_US.ISO_8859-1/articles/gdm-reference/gdm-reference/x135.html For example, if there is a /etc/gdm/gdm.conf it is pretty safe to assume that gnome is installed on that system. So in your PEP, your could have code.. if sys.platform == 'linux2': gnome_installed = os.path.exists('/etc/gdm/gdm.conf') Then exposed that as a variable in your condition: 'if desktop in "gnome|windows"' etc Regards David _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
