[Python-checkins] python/dist/src/Tools/idle EditorWindow.py,1.38.18.2,1.38.18.3

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Mon, 23 Sep 2002 07:17:17 -0700


Update of /cvsroot/python/python/dist/src/Tools/idle
In directory usw-pr-cvs1:/tmp/cvs-serv29838

Modified Files:
      Tag: release22-maint
	EditorWindow.py 
Log Message:
Backport patch #540583: Open MS Help Docs if available.


Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/EditorWindow.py,v
retrieving revision 1.38.18.2
retrieving revision 1.38.18.3
diff -C2 -d -r1.38.18.2 -r1.38.18.3
*** EditorWindow.py	23 Sep 2002 14:06:24 -0000	1.38.18.2
--- EditorWindow.py	23 Sep 2002 14:17:15 -0000	1.38.18.3
***************
*** 296,307 ****
      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.normpath(fn)
          if os.path.isfile(fn):
              help_url = fn
          del fn
  
!     def python_docs(self, event=None):
!         webbrowser.open(self.help_url)
  
      def select_all(self, event=None):
--- 296,316 ----
      if sys.platform[:3] == "win":
          fn = os.path.dirname(__file__)
!         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):
!             os.startfile(self.help_url)
!     else:
!         def python_docs(self, event=None):
!             webbrowser.open(self.help_url)
  
      def select_all(self, event=None):