|
From: Thomas L. <ta...@gm...> - 2010-02-13 15:09:03
|
On 12 February 2010 00:23, Frank Richter <fra...@gm...> wrote:
> 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.
I think we should use a separate attribute for paths. e.g.
<implementation local-dir='.'>
or something like that.
The id (if not given) could be auto-generated as "file:." in this
case, for places where we really do need an ID (e.g. to identify which
implementation you marked as "buggy"), but we could use
Implementation.local_path whenever we really want a pathname. This
would avoid needing magic strings anywhere.
--
Dr Thomas Leonard ROX desktop / Zero Install
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA BD8E 0713 3F96 CA74 D8BA
|