|
From: Frank R. <fra...@gm...> - 2010-02-12 00:48:57
|
On 10.02.2010 15:03, Bastian Eicher wrote:
> I maintain that the best solution would be to mirror Java's (java.exe and
> javaw.exe) and Python's (python.exe and pythonw.exe) design with explicit
> console versions of the 0install wrappers (0launch.exe) and explicit GUI
> versions (0launchw.exe).
Checking whether stdout is a TTY might be a way. (isatty() in C, but I
guess there will be probably some Python way, too.) However, that would
also be triggered by the console version redirected to a file.
> I could set the DISPLAY environment variable to something more or less
> random (like "localhost") in 0launchw.exe. That way 0launch will think
> there's an X Server available and try to use the GTK+ GUI.
That seems like a roundabout way to do a simple boolean flag...
> There would be no need for Windows-specific checks
Platform checks aren't evil... sometimes they're just necessary.
> The ZeroInstall code contains a bunch of .startswith('/') checks to
> differentiate local paths from URLs.
> Unfortunately this is no good on Windows. Here an absolute file-system path
> is signified by a single letter followed by colon.
> Currently the code will fail to locate the local "ZeroInstall-GUI.xml" feed
> for this reason.
The "local path" test should probably be wrapped into a function.
-f.r.
|