[Python-checkins] python/dist/src/Lib webbrowser.py,1.38,1.39

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Tue Oct 4 05:17:53 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2904/Lib

Modified Files:
	webbrowser.py 
Log Message:
Fix pychecker warnings

Index: webbrowser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- webbrowser.py	3 Oct 2005 14:16:44 -0000	1.38
+++ webbrowser.py	4 Oct 2005 03:17:49 -0000	1.39
@@ -134,6 +134,9 @@
     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 @@
         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 @@
 # 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 _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/>



More information about the Python-checkins mailing list