[Python-checkins] python/dist/src/Lib/idlelib EditorWindow.py, 1.59, 1.60 NEWS.txt, 1.37, 1.38 configHelpSourceEdit.py, 1.6, 1.7 idlever.py, 1.16, 1.17

kbk at users.sourceforge.net kbk at users.sourceforge.net
Thu Jul 15 06:54:59 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/idlelib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20235

Modified Files:
	EditorWindow.py NEWS.txt configHelpSourceEdit.py idlever.py 
Log Message:
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


Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/EditorWindow.py,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** EditorWindow.py	6 Jun 2004 01:29:21 -0000	1.59
--- EditorWindow.py	15 Jul 2004 04:54:57 -0000	1.60
***************
*** 61,69 ****
                      dochome = os.path.join(basepath, pyver,
                                             'Doc', 'index.html')
!             elif sys.platform.count('win') or sys.platform.count('nt'):
                  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):
--- 61,68 ----
                      dochome = os.path.join(basepath, pyver,
                                             'Doc', 'index.html')
!             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
              dochome = os.path.normpath(dochome)
              if os.path.isfile(dochome):
***************
*** 315,332 ****
  
      def python_docs(self, event=None):
!         if sys.platform.count('win') or sys.platform.count('nt'):
              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)
  
      def cut(self,event):
--- 314,322 ----
  
      def python_docs(self, event=None):
!         if sys.platform[:3] == 'win':
              os.startfile(self.help_url)
          else:
              webbrowser.open(self.help_url)
!         return "break"
  
      def cut(self,event):
***************
*** 579,583 ****
          "Create a callback with the helpfile value frozen at definition time"
          def display_extra_help(helpfile=helpfile):
!             self.display_docs(helpfile)
          return display_extra_help
  
--- 569,578 ----
          "Create a callback with the helpfile value frozen at definition time"
          def display_extra_help(helpfile=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
  

Index: NEWS.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** NEWS.txt	8 Jul 2004 05:59:42 -0000	1.37
--- NEWS.txt	15 Jul 2004 04:54:57 -0000	1.38
***************
*** 1,2 ****
--- 1,11 ----
+ What's New in IDLE 1.1a2?
+ =========================
+ 
+ *Release date: XX-JUL-2004*
+ 
+ - checking sys.platform for substring 'win' was breaking IDLE docs on Mac
+   (darwin).  Also, Mac Safari browser requires full file:// URIs.  SF 900580.
+ 
+ 
  What's New in IDLE 1.1a1?
  =========================

Index: configHelpSourceEdit.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/configHelpSourceEdit.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** configHelpSourceEdit.py	27 Jan 2003 02:36:18 -0000	1.6
--- configHelpSourceEdit.py	15 Jul 2004 04:54:57 -0000	1.7
***************
*** 2,5 ****
--- 2,6 ----
  
  import os
+ import sys
  
  from Tkinter import *
***************
*** 85,89 ****
          else:
              base = None
!             if sys.platform.count('win') or sys.platform.count('nt'):
                  dir = os.path.join(os.path.dirname(sys.executable), 'Doc')
                  if not os.path.isdir(dir):
--- 86,90 ----
          else:
              base = None
!             if sys.platform[:3] == 'win':
                  dir = os.path.join(os.path.dirname(sys.executable), 'Doc')
                  if not os.path.isdir(dir):
***************
*** 128,138 ****
              pathOk = False
          elif path.startswith('www.') or path.startswith('http'):
!             pathOk = True
!         elif not os.path.exists(path):
!             tkMessageBox.showerror(title='File Path Error',
!                                    message='Help file path does not exist.',
!                                    parent=self)
!             self.entryPath.focus_set()
!             pathOk = False
          return pathOk
  
--- 129,142 ----
              pathOk = False
          elif path.startswith('www.') or path.startswith('http'):
!             pass
!         else:
!             if path[:5] == 'file:':
!                 path = path[5:]
!             if not os.path.exists(path):
!                 tkMessageBox.showerror(title='File Path Error',
!                                        message='Help file path does not exist.',
!                                        parent=self)
!                 self.entryPath.focus_set()
!                 pathOk = False
          return pathOk
  
***************
*** 141,144 ****
--- 145,156 ----
              self.result = (self.menu.get().strip(),
                             self.path.get().strip())
+             if sys.platform == 'darwin':
+                 path = self.result[1]
+                 if (path.startswith('www') or path.startswith('file:')
+                     or path.startswith('http:')):
+                     pass
+                 else:
+                     # Mac Safari insists on using the URI form for local files
+                     self.result[1] = "file://" + path
              self.destroy()
  

Index: idlever.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/idlever.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** idlever.py	24 Nov 2003 03:23:16 -0000	1.16
--- idlever.py	15 Jul 2004 04:54:57 -0000	1.17
***************
*** 1 ****
! IDLE_VERSION = "1.1a0"
--- 1 ----
! IDLE_VERSION = "1.1a2"



More information about the Python-checkins mailing list