mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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
1 changed files with 16 additions and 14 deletions
|
@ -12,6 +12,12 @@ import imp
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import tkSimpleDialog
|
import tkSimpleDialog
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
|
try:
|
||||||
|
import webbrowser
|
||||||
|
except ImportError:
|
||||||
|
import BrowserControl
|
||||||
|
webbrowser = BrowserControl
|
||||||
|
del BrowserControl
|
||||||
import idlever
|
import idlever
|
||||||
import WindowList
|
import WindowList
|
||||||
from IdleConf import idleconf
|
from IdleConf import idleconf
|
||||||
|
@ -32,6 +38,7 @@ TK_TABWIDTH_DEFAULT = 8
|
||||||
#$ event <<open-path-browser>>
|
#$ event <<open-path-browser>>
|
||||||
|
|
||||||
#$ event <<close-window>>
|
#$ event <<close-window>>
|
||||||
|
|
||||||
#$ unix <Control-x><Control-0>
|
#$ unix <Control-x><Control-0>
|
||||||
#$ unix <Control-x><Key-0>
|
#$ unix <Control-x><Key-0>
|
||||||
#$ win <Alt-F4>
|
#$ win <Alt-F4>
|
||||||
|
@ -303,22 +310,17 @@ class EditorWindow:
|
||||||
else:
|
else:
|
||||||
self.io.loadfile(helpfile)
|
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/"
|
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):
|
def python_docs(self, event=None):
|
||||||
if sys.platform=='win32':
|
webbrowser.open(self.help_url)
|
||||||
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):
|
def select_all(self, event=None):
|
||||||
self.text.tag_add("sel", "1.0", "end-1c")
|
self.text.tag_add("sel", "1.0", "end-1c")
|
||||||
|
@ -688,7 +690,7 @@ class EditorWindow:
|
||||||
if self.get_tabwidth() != newtabwidth:
|
if self.get_tabwidth() != newtabwidth:
|
||||||
pixels = text.tk.call("font", "measure", text["font"],
|
pixels = text.tk.call("font", "measure", text["font"],
|
||||||
"-displayof", text.master,
|
"-displayof", text.master,
|
||||||
"n" * newtabwith)
|
"n" * newtabwidth)
|
||||||
text.configure(tabs=pixels)
|
text.configure(tabs=pixels)
|
||||||
|
|
||||||
def prepstr(s):
|
def prepstr(s):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue