|
From: Bastian E. <ba...@ei...> - 2010-02-12 14:55:27
|
> > The ZeroInstall code contains a bunch of .startswith('/') checks to
> > differentiate local paths from URLs.
>
> Use os.path.isabs() instead.
I have done this locally now.
Shouldn't this be changed directly in the master branch instead of only the
Windows branch?
----------
The 0launch implementation selection GUI code located in get_selections_gui
in Zeroinstall/helpers.py uses "socket.socketpair()" and "os.fork()" which
don't seem to work on Windows.
----------
> > 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...
True. The best way would probably be to replace all the
"os.environ.get('DISPLAY', None)" calls with a common helper function with a
Platform check.
However, I am not a Python developer myself and thus so far not a patch
contributor. Therefore just setting the DISPLAY variable from the outside
seemed like a reasonable workaround for the time being.
----------
> 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.
Think of the following two scenarios:
User launches 0launch from the console and wants 0launch's output to appear
on that same console. This can only be achieved by a non-GUI application.
User launches 0launch via a Windows shortcut and does not want a black box
to pop up. This can only be achieved by a GUI application.
I don't really see how checking if stdout is connected to a terminal would
help.
The fact that neither the Java nor the Python developers came up with a
better idea than creating separate Console- und GUI-versions of their
interpreter EXEs is a strong indicator for me that this is simply a
"weakness" of the Windows platform we will have to live with.
|