Commit 8aea84cf authored by Fred Drake's avatar Fred Drake

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.
parent 4cd5c18e
...@@ -6,6 +6,7 @@ import imp ...@@ -6,6 +6,7 @@ import imp
from Tkinter import * from Tkinter import *
import tkSimpleDialog import tkSimpleDialog
import tkMessageBox import tkMessageBox
import browser
import idlever import idlever
import WindowList import WindowList
from IdleConf import idleconf from IdleConf import idleconf
...@@ -288,14 +289,16 @@ class EditorWindow: ...@@ -288,14 +289,16 @@ class EditorWindow:
else: else:
self.io.loadfile(helpfile) 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/" 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): def python_docs(self, event=None):
cmd = self.help_viewer % {"url": self.help_url} browser.open(self.help_url)
os.system(cmd)
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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment