diff options
author | Fred Drake <fdrake@acm.org> | 2000-07-09 19:10:19 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-07-09 19:10:19 (GMT) |
commit | 3637799afe046be1a1a47ce53da404745f828452 (patch) | |
tree | 5023bdf4e0598ae726c002a4168f7d2159788859 /Tools/idle | |
parent | bb7eeff44a893f6d97f418e69c6387ac24b90a63 (diff) | |
download | cpython-3637799afe046be1a1a47ce53da404745f828452.zip cpython-3637799afe046be1a1a47ce53da404745f828452.tar.gz cpython-3637799afe046be1a1a47ce53da404745f828452.tar.bz2 |
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.
Diffstat (limited to 'Tools/idle')
-rw-r--r-- | Tools/idle/EditorWindow.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index 53f2520..d744a2e 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -6,7 +6,12 @@ import imp from Tkinter import * import tkSimpleDialog import tkMessageBox -import BrowserControl +try: + import webbrowser +except ImportError: + import BrowserControl + webbrowser = BrowserControl + del BrowserControl import idlever import WindowList from IdleConf import idleconf @@ -27,6 +32,7 @@ TK_TABWIDTH_DEFAULT = 8 #$ event <<open-path-browser>> #$ event <<close-window>> + #$ unix <Control-x><Control-0> #$ unix <Control-x><Key-0> #$ win <Alt-F4> @@ -298,7 +304,7 @@ class EditorWindow: del fn def python_docs(self, event=None): - BrowserControl.open(self.help_url) + webbrowser.open(self.help_url) def select_all(self, event=None): self.text.tag_add("sel", "1.0", "end-1c") |