mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Update to use the new standard webbrowser module if available, otherwise
uses the BrowserControl module. BrowserControl is not removed to allow IDLE to be distributed separately and still be used with Python 1.5.2.
This commit is contained in:
parent
bb7eeff44a
commit
3637799afe
1 changed files with 8 additions and 2 deletions
|
|
@ -6,7 +6,12 @@ import imp
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import tkSimpleDialog
|
import tkSimpleDialog
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
import BrowserControl
|
try:
|
||||||
|
import webbrowser
|
||||||
|
except ImportError:
|
||||||
|
import BrowserControl
|
||||||
|
webbrowser = BrowserControl
|
||||||
|
del BrowserControl
|
||||||
import idlever
|
import idlever
|
||||||
import WindowList
|
import WindowList
|
||||||
from IdleConf import idleconf
|
from IdleConf import idleconf
|
||||||
|
|
@ -27,6 +32,7 @@ TK_TABWIDTH_DEFAULT = 8
|
||||||
#$ event <<open-path-browser>>
|
#$ event <<open-path-browser>>
|
||||||
|
|
||||||
#$ event <<close-window>>
|
#$ event <<close-window>>
|
||||||
|
|
||||||
#$ unix <Control-x><Control-0>
|
#$ unix <Control-x><Control-0>
|
||||||
#$ unix <Control-x><Key-0>
|
#$ unix <Control-x><Key-0>
|
||||||
#$ win <Alt-F4>
|
#$ win <Alt-F4>
|
||||||
|
|
@ -298,7 +304,7 @@ class EditorWindow:
|
||||||
del fn
|
del fn
|
||||||
|
|
||||||
def python_docs(self, event=None):
|
def python_docs(self, event=None):
|
||||||
BrowserControl.open(self.help_url)
|
webbrowser.open(self.help_url)
|
||||||
|
|
||||||
def select_all(self, event=None):
|
def select_all(self, event=None):
|
||||||
self.text.tag_add("sel", "1.0", "end-1c")
|
self.text.tag_add("sel", "1.0", "end-1c")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue