Kaydet (Commit) 30d4ceb2 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Backport patch #540583: Open MS Help Docs if available.

üst 1d429f24
...@@ -295,14 +295,23 @@ class EditorWindow: ...@@ -295,14 +295,23 @@ class EditorWindow:
help_url = "http://www.python.org/doc/current/" help_url = "http://www.python.org/doc/current/"
if sys.platform[:3] == "win": if sys.platform[:3] == "win":
fn = os.path.dirname(__file__) 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) fn = os.path.normpath(fn)
if os.path.isfile(fn): if os.path.isfile(fn):
help_url = 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 del fn
def python_docs(self, event=None): def python_docs(self, event=None):
webbrowser.open(self.help_url) os.startfile(self.help_url)
else:
def python_docs(self, event=None):
webbrowser.open(self.help_url)
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