summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2004-07-15 04:54:57 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2004-07-15 04:54:57 (GMT)
commit8aa23927e339ca13459dd408751546352d81fefa (patch)
treedea516dd6ea1ea1db72769f96cfabcf86be3243f /Lib/idlelib/EditorWindow.py
parent69dc1c8f6a6deffbc6fa076d9df4ffc3e3d85afa (diff)
downloadcpython-8aa23927e339ca13459dd408751546352d81fefa.zip
cpython-8aa23927e339ca13459dd408751546352d81fefa.tar.gz
cpython-8aa23927e339ca13459dd408751546352d81fefa.tar.bz2
Checking sys.platform for substring 'win' was breaking IDLE docs on Mac
(darwin). Also, Mac Safari browser requires full file:// URIs. SF 900580 M EditorWindow.py M NEWS.txt M configHelpSourceEdit.py M idlever.py
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 36cbb14..41d26e5 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -60,11 +60,10 @@ class EditorWindow:
basepath = '/usr/share/doc/' # standard location
dochome = os.path.join(basepath, pyver,
'Doc', 'index.html')
- elif sys.platform.count('win') or sys.platform.count('nt'):
+ elif sys.platform[:3] == 'win':
chmfile = os.path.join(sys.prefix, "Python%d%d.chm" % sys.version_info[:2])
if os.path.isfile(chmfile):
dochome = chmfile
- print "dochome =", dochome
dochome = os.path.normpath(dochome)
if os.path.isfile(dochome):
EditorWindow.help_url = dochome
@@ -314,20 +313,11 @@ class EditorWindow:
textView.TextViewer(self.top,'Help',fn)
def python_docs(self, event=None):
- if sys.platform.count('win') or sys.platform.count('nt'):
+ if sys.platform[:3] == 'win':
os.startfile(self.help_url)
- return "break"
else:
webbrowser.open(self.help_url)
- return "break"
-
- def display_docs(self, url):
- if not (url.startswith('www') or url.startswith('http')):
- url = os.path.normpath(url)
- if sys.platform.count('win') or sys.platform.count('nt'):
- os.startfile(url)
- else:
- webbrowser.open(url)
+ return "break"
def cut(self,event):
self.text.event_generate("<<Cut>>")
@@ -578,7 +568,12 @@ class EditorWindow:
def __extra_help_callback(self, helpfile):
"Create a callback with the helpfile value frozen at definition time"
def display_extra_help(helpfile=helpfile):
- self.display_docs(helpfile)
+ if not (helpfile.startswith('www') or helpfile.startswith('http')):
+ url = os.path.normpath(helpfile)
+ if sys.platform[:3] == 'win':
+ os.startfile(helpfile)
+ else:
+ webbrowser.open(helpfile)
return display_extra_help
def update_recent_files_list(self, new_file=None):