alejandrogomez/turses — pull request #103 by ivanov (2012-07-09 07:19:32+00:00)
Title: Better browser support

The nice thing about the `webbrowser` module is that it already respects
the `$BROWSER` environment variable, so no extra logic is necessary to
handle it.

The advantage is that `webbrowser` does not *require* `$BROWSER` to be
set, and will still open something sensible up and not require setting
it (I was a bit disturbed by getting an error message for something as
simple as opening a URL).

I verified that this works with:

BROWSER= turses
BROWSER=firefox turses
BROWSER=chromium turses
BROWSER=w3m turses

Additionally, when there are multiple URLS, we now open open them
separately. This is required since `webbrowser` only has a generic
"open" method, and not all webbrowsers support opening multiple URLs in
one go (w3m does not, for example). This is not noticeable when using
Chromium or Firefox, since new tabs are opened for each URL, so it is
functionally equivalent with what used to work, but for BROWSER=w3m,
which just did not work at all before this commit, now it will open up
the first URL in the foreground, and when the user quits that session,
it opens up another session with the next URL.

`open_urls_in_browser` now expects the `urls` argument to be an iterable,
and `open_status_url` has been updated to use it properly.