[Idle-dev] CVS: idle EditorWindow.py,1.2,1.3
Kurt B. Kaiser
kbk@users.sourceforge.net
Thu, 12 Jul 2001 20:35:34 -0700
Update of /cvsroot/idlefork/idle
In directory usw-pr-cvs1:/tmp/cvs-serv30363
Modified Files:
EditorWindow.py
Log Message:
py-cvs-rel2_1 (Rev 1.33 - 1.37) merge
VP IDLE version depended on VP's ExecBinding.py and spawn.py to get the
path to the Windows Doc directory (relative to python.exe). Removed this
conflicting code in favor of py-cvs updates which on Windows use a hard
coded path relative to the location of this module. py-cvs updates include
support for webbrowser.py. Module still has BrowserControl.py for 1.5.2
support.
At this point, the differences wrt py-cvs relate to menu functionality.
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** EditorWindow.py 2001/07/04 03:15:10 1.2
--- EditorWindow.py 2001/07/13 03:35:32 1.3
***************
*** 13,16 ****
--- 13,22 ----
import tkSimpleDialog
import tkMessageBox
+ try:
+ import webbrowser
+ except ImportError:
+ import BrowserControl
+ webbrowser = BrowserControl
+ del BrowserControl
import idlever
import WindowList
***************
*** 33,36 ****
--- 39,43 ----
#$ event <<close-window>>
+
#$ unix <Control-x><Control-0>
#$ unix <Control-x><Key-0>
***************
*** 304,323 ****
self.io.loadfile(helpfile)
- 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):
! if sys.platform=='win32':
! try:
! import win32api
! import ExecBinding
! doc = os.path.join( os.path.dirname( ExecBinding.pyth_exe ), "doc", "index.html" )
! win32api.ShellExecute(0, None, doc, None, sys.path[0], 1)
! except:
! pass
! else:
! cmd = self.help_viewer % {"url": self.help_url}
! os.system(cmd)
def select_all(self, event=None):
--- 311,325 ----
self.io.loadfile(helpfile)
help_url = "http://www.python.org/doc/current/"
+ if sys.platform[:3] == "win":
+ fn = os.path.dirname(__file__)
+ fn = os.path.join(fn, "../../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):
***************
*** 689,693 ****
pixels = text.tk.call("font", "measure", text["font"],
"-displayof", text.master,
! "n" * newtabwith)
text.configure(tabs=pixels)
--- 691,695 ----
pixels = text.tk.call("font", "measure", text["font"],
"-displayof", text.master,
! "n" * newtabwidth)
text.configure(tabs=pixels)