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.
This commit is contained in:
parent
fad225f1ba
commit
afdf71b9ee
|
@ -12,6 +12,12 @@ import imp
|
|||
from Tkinter import *
|
||||
import tkSimpleDialog
|
||||
import tkMessageBox
|
||||
try:
|
||||
import webbrowser
|
||||
except ImportError:
|
||||
import BrowserControl
|
||||
webbrowser = BrowserControl
|
||||
del BrowserControl
|
||||
import idlever
|
||||
import WindowList
|
||||
from IdleConf import idleconf
|
||||
|
@ -32,6 +38,7 @@ TK_TABWIDTH_DEFAULT = 8
|
|||
#$ event <<open-path-browser>>
|
||||
|
||||
#$ event <<close-window>>
|
||||
|
||||
#$ unix <Control-x><Control-0>
|
||||
#$ unix <Control-x><Key-0>
|
||||
#$ win <Alt-F4>
|
||||
|
@ -303,22 +310,17 @@ class EditorWindow:
|
|||
else:
|
||||
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/"
|
||||
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):
|
||||
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)
|
||||
webbrowser.open(self.help_url)
|
||||
|
||||
def select_all(self, event=None):
|
||||
self.text.tag_add("sel", "1.0", "end-1c")
|
||||
|
@ -688,7 +690,7 @@ class EditorWindow:
|
|||
if self.get_tabwidth() != newtabwidth:
|
||||
pixels = text.tk.call("font", "measure", text["font"],
|
||||
"-displayof", text.master,
|
||||
"n" * newtabwith)
|
||||
"n" * newtabwidth)
|
||||
text.configure(tabs=pixels)
|
||||
|
||||
def prepstr(s):
|
||||
|
|
Loading…
Reference in New Issue