diff options
author | Fred Drake <fdrake@acm.org> | 2000-05-10 16:50:07 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-05-10 16:50:07 (GMT) |
commit | 8638ace511263de2cbe0031f51712d831aba2c22 (patch) | |
tree | b1adea196b149377abfeceaff9d68f54ae762081 /Tools | |
parent | 95a40001e618a7f11ae7091b707459a01cd65af9 (diff) | |
download | cpython-8638ace511263de2cbe0031f51712d831aba2c22.zip cpython-8638ace511263de2cbe0031f51712d831aba2c22.tar.gz cpython-8638ace511263de2cbe0031f51712d831aba2c22.tar.bz2 |
EditorWindow.python_docs():
Instead of using Netscape through os.system(), use the new
browser.open() function to load the documentation on the
default browser. On Windows, this will use the installed
documentation if it exists, instead of hitting python.org.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/idle/EditorWindow.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Tools/idle/EditorWindow.py b/Tools/idle/EditorWindow.py index 15820b5..1516118 100644 --- a/Tools/idle/EditorWindow.py +++ b/Tools/idle/EditorWindow.py @@ -6,6 +6,7 @@ import imp from Tkinter import * import tkSimpleDialog import tkMessageBox +import browser import idlever import WindowList from IdleConf import idleconf @@ -288,14 +289,16 @@ class EditorWindow: else: self.io.loadfile(helpfile) - # XXX Fix these for Windows - help_viewer = "netscape -remote 'openurl(%(url)s)' 2>/dev/null || " \ - "netscape %(url)s &" help_url = "http://www.python.org/doc/current/" + if sys.platform[:3] == "win": + fn = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + fn = os.path.join(fn, "Doc", "index.html") + if os.path.isfile(fn): + help_url = fn + del fn def python_docs(self, event=None): - cmd = self.help_viewer % {"url": self.help_url} - os.system(cmd) + browser.open(self.help_url) def select_all(self, event=None): self.text.tag_add("sel", "1.0", "end-1c") |