summaryrefslogtreecommitdiffstats
path: root/Lib/webbrowser.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-10-04 03:17:49 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-10-04 03:17:49 (GMT)
commit196f733d935bd51f8674c9761420ce990694f33a (patch)
tree651eefa5d2c605433a899f2038ae440cfe775093 /Lib/webbrowser.py
parent389482ccbe6378f039667aa5db3192bbabec741c (diff)
downloadcpython-196f733d935bd51f8674c9761420ce990694f33a.zip
cpython-196f733d935bd51f8674c9761420ce990694f33a.tar.gz
cpython-196f733d935bd51f8674c9761420ce990694f33a.tar.bz2
Fix pychecker warnings
Diffstat (limited to 'Lib/webbrowser.py')
-rw-r--r--Lib/webbrowser.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 6c34f8b..1cef724 100644
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -134,6 +134,9 @@ class BaseBrowser(object):
def __init__(self, name=""):
self.name = name
+ def open(self, url, new=0, autoraise=1):
+ raise NotImplementedError
+
def open_new(self, url):
return self.open(url, 1)
@@ -171,7 +174,7 @@ class UnixBrowser(BaseBrowser):
raise_opt = self.raise_opts and self.raise_opts[autoraise] or ''
cmd = "%s %s %s '%s' >/dev/null 2>&1" % (self.name, raise_opt,
self.remote_cmd, action)
- if remote_background:
+ if self.remote_background:
cmd += ' &'
rc = os.system(cmd)
if rc:
@@ -333,9 +336,7 @@ class Grail(BaseBrowser):
# These are the right tests because all these Unix browsers require either
# a console terminal or an X display to run.
-# Prefer X browsers if present
-if os.environ.get("DISPLAY"):
-
+def register_X_browsers():
# First, the Mozilla/Netscape browsers
for browser in ("mozilla-firefox", "firefox",
"mozilla-firebird", "firebird",
@@ -381,6 +382,10 @@ if os.environ.get("DISPLAY"):
if _iscommand("grail"):
register("grail", Grail, None)
+# Prefer X browsers if present
+if os.environ.get("DISPLAY"):
+ register_X_browsers()
+
# Also try console browsers
if os.environ.get("TERM"):
# The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links/>