[Python-checkins] CVS: python/dist/src/Tools/idle EditorWindow.py,1.32,1.33

Fred Drake python-dev@python.org
Wed, 10 May 2000 12:50:10 -0400


Update of /projects/cvsroot/python/dist/src/Tools/idle
In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Tools/idle

Modified Files:
	EditorWindow.py 
Log Message:

EditorWindow.python_docs():
        Instead of using Netscape through os.system(), use the new
        browser.open() function to load the documentation on the
        default browser.  On Windows, this will use the installed
        documentation if it exists, instead of hitting python.org.


Index: EditorWindow.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Tools/idle/EditorWindow.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** EditorWindow.py	2000/03/07 17:56:27	1.32
--- EditorWindow.py	2000/05/10 16:50:07	1.33
***************
*** 7,10 ****
--- 7,11 ----
  import tkSimpleDialog
  import tkMessageBox
+ import browser
  import idlever
  import WindowList
***************
*** 289,300 ****
              self.io.loadfile(helpfile)
  
-     # XXX Fix these for Windows
-     help_viewer = "netscape -remote 'openurl(%(url)s)' 2>/dev/null || " \
-                   "netscape %(url)s &"
      help_url = "http://www.python.org/doc/current/"
  
      def python_docs(self, event=None):
!         cmd = self.help_viewer % {"url": self.help_url}
!         os.system(cmd)
  
      def select_all(self, event=None):
--- 290,303 ----
              self.io.loadfile(helpfile)
  
      help_url = "http://www.python.org/doc/current/"
+     if sys.platform[:3] == "win":
+         fn = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+         fn = os.path.join(fn, "Doc", "index.html")
+         if os.path.isfile(fn):
+             help_url = fn
+         del fn
  
      def python_docs(self, event=None):
!         browser.open(self.help_url)
  
      def select_all(self, event=None):