1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#! /bin/sh -e
# DP: Recognize other browsers: www-browser, x-www-browser, firefox, iceweasel, iceape.
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
--- Lib/webbrowser.py~ 2005-09-15 09:29:38.000000000 +0200
+++ Lib/webbrowser.py 2007-01-12 01:42:30.000000000 +0100
@@ -261,10 +261,13 @@
# the TERM and DISPLAY cases, because we might be running Python from inside
# an xterm.
if os.environ.get("TERM") or os.environ.get("DISPLAY"):
- _tryorder = ["links", "lynx", "w3m"]
+ _tryorder = ["www-browser", "links", "lynx", "w3m"]
# Easy cases first -- register console browsers if we have them.
if os.environ.get("TERM"):
+ # a generic browser command handled by alternatives
+ if _iscommand("www-browser"):
+ register("www-browser", None, GenericBrowser("www-browser '%s'"))
# The Links browser <http://artax.karlin.mff.cuni.cz/~mikulas/links/>
if _iscommand("links"):
register("links", None, GenericBrowser("links '%s'"))
@@ -277,12 +280,18 @@
# X browsers have more in the way of options
if os.environ.get("DISPLAY"):
- _tryorder = ["galeon", "skipstone",
+ _tryorder = ["x-www-browser", "galeon", "skipstone",
+ "firefox", "iceweasel", "iceape",
"mozilla-firefox", "mozilla-firebird", "mozilla", "netscape",
"kfm", "grail"] + _tryorder
+ # a generic browser command handled by alternatives
+ if _iscommand("x-www-browser"):
+ register("x-www-browser", None, GenericBrowser("x-www-browser '%s'"))
+
# First, the Netscape series
- for browser in ("mozilla-firefox", "mozilla-firebird",
+ for browser in ("firefox", "iceweasel", "iceape",
+ "mozilla-firefox", "mozilla-firebird",
"mozilla", "netscape"):
if _iscommand(browser):
register(browser, None, Netscape(browser))
|