mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #27156: Remove obsolete code not used by IDLE.
help.txt, replaced by help.html, is out-of-date and should not be used. Its dedicated viewer has be replaced by the html viewer in help.py. 'import idlever; I = idlever.IDLE_VERSION' is the same as 'import sys; I = version[:version.index(' ')]'
This commit is contained in:
parent
dd780e4423
commit
5a0c278ad4
3 changed files with 0 additions and 432 deletions
|
@ -40,54 +40,6 @@ def _sphinx_version():
|
|||
return release
|
||||
|
||||
|
||||
class HelpDialog(object):
|
||||
|
||||
def __init__(self):
|
||||
self.parent = None # parent of help window
|
||||
self.dlg = None # the help window iteself
|
||||
|
||||
def display(self, parent, near=None):
|
||||
""" Display the help dialog.
|
||||
|
||||
parent - parent widget for the help window
|
||||
|
||||
near - a Toplevel widget (e.g. EditorWindow or PyShell)
|
||||
to use as a reference for placing the help window
|
||||
"""
|
||||
import warnings as w
|
||||
w.warn("EditorWindow.HelpDialog is no longer used by Idle.\n"
|
||||
"It will be removed in 3.6 or later.\n"
|
||||
"It has been replaced by private help.HelpWindow\n",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
if self.dlg is None:
|
||||
self.show_dialog(parent)
|
||||
if near:
|
||||
self.nearwindow(near)
|
||||
|
||||
def show_dialog(self, parent):
|
||||
self.parent = parent
|
||||
fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt')
|
||||
self.dlg = dlg = textview.view_file(parent,'Help',fn, modal=False)
|
||||
dlg.bind('<Destroy>', self.destroy, '+')
|
||||
|
||||
def nearwindow(self, near):
|
||||
# Place the help dialog near the window specified by parent.
|
||||
# Note - this may not reposition the window in Metacity
|
||||
# if "/apps/metacity/general/disable_workarounds" is enabled
|
||||
dlg = self.dlg
|
||||
geom = (near.winfo_rootx() + 10, near.winfo_rooty() + 10)
|
||||
dlg.withdraw()
|
||||
dlg.geometry("=+%d+%d" % geom)
|
||||
dlg.deiconify()
|
||||
dlg.lift()
|
||||
|
||||
def destroy(self, ev=None):
|
||||
self.dlg = None
|
||||
self.parent = None
|
||||
|
||||
helpDialog = HelpDialog() # singleton instance, no longer used
|
||||
|
||||
|
||||
class EditorWindow(object):
|
||||
from idlelib.percolator import Percolator
|
||||
from idlelib.colorizer import ColorDelegator, color_config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue