Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 931625d

Browse files
author
Steven M. Gava
committed
tracking python idle changes:
Patch #540583: Open MS Help Docs if available.
1 parent 8ee3cd4 commit 931625d

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

Lib/idlelib/EditorWindow.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,22 @@ def help_dialog(self, event=None):
325325
help_url = "http://www.python.org/doc/current/"
326326
if sys.platform[:3] == "win":
327327
fn = os.path.dirname(__file__)
328-
fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html")
328+
fn = os.path.join(fn, os.pardir, os.pardir, "pythlp.chm")
329329
fn = os.path.normpath(fn)
330330
if os.path.isfile(fn):
331331
help_url = fn
332+
else:
333+
fn = os.path.dirname(__file__)
334+
fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html")
335+
fn = os.path.normpath(fn)
336+
if os.path.isfile(fn):
337+
help_url = fn
332338
del fn
333-
334-
def python_docs(self, event=None):
335-
self.display_docs(self.help_url)
339+
def python_docs(self, event=None):
340+
os.startfile(self.help_url)
341+
else:
342+
def python_docs(self, event=None):
343+
self.display_docs(self.help_url)
336344

337345
def display_docs(self, url):
338346
webbrowser.open(url)

0 commit comments

Comments
 (0)