how to tell wx.LaunchDefaultBrowser what to launch?

I'm having a problem with wx.LaunchDefaultBrowser. It doesn't seem to
be launching my default browser (firefox) in a specific situation. If
I give it a uri like "file:foo.html" it ends up starting konquerer
pointed at "smb://foo.html/". What's really strange is that this only
happens if I ssh to this (unix) box from some other machine. If I run
the same code while logged on to that machine firefox starts right up.

What can I do to fix this? Setting the environment variable BROWSER
has no effect.

Any ideas?

Bryan Oakley wrote:

I'm having a problem with wx.LaunchDefaultBrowser. It doesn't seem to
be launching my default browser (firefox) in a specific situation. If
I give it a uri like "file:foo.html" it ends up starting konquerer
pointed at "smb://foo.html/". What's really strange is that this only
happens if I ssh to this (unix) box from some other machine. If I run
the same code while logged on to that machine firefox starts right up.

What can I do to fix this? Setting the environment variable BROWSER
has no effect.

BROWSER is actually the last thing it tries in a chain of possibilities. Here is what the function tries on Unix systems, in order:

1. If xdg-open is on the PATH then it runs that utility, passing it the URL to be opened.

2. If wx is able to determine the desktop environment, then on GNOME it runs gconftool-2 to get the default browser, and on KDE it passes the URL to kfmclient.

3. Next it uses the wxMimeTypesManager to find out if there is anything associated with the ".html" extension and uses that if so. (This will check various places for file associations, including desktop environment specific files, mimetypes DB, etc.

4. Finally, it uses the contents of the BROWSER variable, if it is set.

···

--
Robin Dunn
Software Craftsman