[Python-checkins] CVS: python/dist/src/Lib webbrowser.py,1.8,1.9
Eric S. Raymond
esr@users.sourceforge.net
Tue, 23 Jan 2001 05:49:46 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv10699/Lib
Modified Files:
webbrowser.py
Log Message:
Expose the autoraise capability. Improve the documentation.
Index: webbrowser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** webbrowser.py 2001/01/23 13:16:32 1.8
--- webbrowser.py 2001/01/23 13:49:44 1.9
***************
*** 35,40 ****
# Please note: the following definition hides a builtin function.
! def open(url, new=0):
! get().open(url, new)
def open_new(url): # Marked deprecated. May be removed in 2.1.
--- 35,40 ----
# Please note: the following definition hides a builtin function.
! def open(url, new=0, autoraise=1):
! get().open(url, new, autoraise)
def open_new(url): # Marked deprecated. May be removed in 2.1.
***************
*** 100,110 ****
class Netscape:
"Launcher class for Netscape browsers."
- autoRaise = 1
-
def __init__(self, name):
self.name = name
! def _remote(self, action):
! raise_opt = ("-noraise", "-raise")[self.autoRaise]
cmd = "%s %s -remote '%s' >/dev/null 2>&1" % (self.name, raise_opt, action)
rc = os.system(cmd)
--- 100,108 ----
class Netscape:
"Launcher class for Netscape browsers."
def __init__(self, name):
self.name = name
! def _remote(self, action, autoraise):
! raise_opt = ("-noraise", "-raise")[autoraise]
cmd = "%s %s -remote '%s' >/dev/null 2>&1" % (self.name, raise_opt, action)
rc = os.system(cmd)
***************
*** 116,124 ****
return not rc
! def open(self, url, new=0):
if new:
! self._remote("openURL(%s, new-window)" % url)
else:
! self._remote("openURL(%s)" % url)
# Deprecated. May be removed in 2.1.
--- 114,122 ----
return not rc
! def open(self, url, new=0, autoraise=1):
if new:
! self._remote("openURL(%s, new-window)"%url, autoraise)
else:
! self._remote("openURL(%s)" % url, autoraise)
# Deprecated. May be removed in 2.1.
***************
*** 160,164 ****
# Deprecated. May be removed in 2.1.
open_new = open
-
register("kfm", Konqueror, None)
--- 158,161 ----