Patch #540583: Open MS Help Docs if available.

This commit is contained in:
Martin v. Löwis 2002-04-14 10:30:51 +00:00
parent 2f6d4da278
commit dcd2dc2fff
1 changed files with 12 additions and 3 deletions

View File

@ -294,14 +294,23 @@ class EditorWindow:
help_url = "http://www.python.org/doc/current/"
if sys.platform[:3] == "win":
fn = os.path.dirname(__file__)
fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html")
fn = os.path.join(fn, os.pardir, os.pardir, "pythlp.chm")
fn = os.path.normpath(fn)
if os.path.isfile(fn):
help_url = fn
else:
fn = os.path.dirname(__file__)
fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html")
fn = os.path.normpath(fn)
if os.path.isfile(fn):
help_url = fn
del fn
def python_docs(self, event=None):
webbrowser.open(self.help_url)
def python_docs(self, event=None):
os.startfile(self.help_url)
else:
def python_docs(self, event=None):
webbrowser.open(self.help_url)
def select_all(self, event=None):
self.text.tag_add("sel", "1.0", "end-1c")