cpython: 4038508240a1 (original) (raw)
Mercurial > cpython
changeset 98090:4038508240a1 2.7
Issue #16893: Replace help.txt with idle.html for Idle doc display. The new idlelib/idle.html is copied from Doc/build/html/idle.html. It looks better than help.txt and will better document Idle as released. The tkinter html viewer that works for this file was written by Rose Roseman. The new code is in idlelib/help.py, a new file for help menu classes. The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated. [#16893]
Terry Jan Reedy tjreedy@udel.edu | |
---|---|
date | Sun, 20 Sep 2015 19:55:44 -0400 |
parents | 96eff21fc47e |
children | 52510bc368f8 |
files | Lib/idlelib/EditorWindow.py Lib/idlelib/help.txt Lib/idlelib/idle_test/htest.py Lib/idlelib/macosxSupport.py |
diffstat | 4 files changed, 23 insertions(+), 12 deletions(-)[+] [-] Lib/idlelib/EditorWindow.py 12 Lib/idlelib/help.txt 4 Lib/idlelib/idle_test/htest.py 14 Lib/idlelib/macosxSupport.py 5 |
line wrap: on
line diff
--- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -17,6 +17,7 @@ from idlelib import PyParse from idlelib.configHandler import idleConf from idlelib import aboutDialog, textView, configDialog from idlelib import macosxSupport +from idlelib import help
The default tab setting for a Text widget, in average-width characters.
TK_TABWIDTH_DEFAULT = 8 @@ -71,6 +72,11 @@ def _find_module(fullname, path=None): class HelpDialog(object): def init(self):
import warnings as w[](#l1.15)
w.warn("EditorWindow.HelpDialog is no longer used by Idle.\n"[](#l1.16)
"It will be removed in 3.6 or later.\n"[](#l1.17)
"It has been replaced by private help.HelpWindow\n",[](#l1.18)
DeprecationWarning, stacklevel=2)[](#l1.19) self.parent = None # parent of help window[](#l1.20) self.dlg = None # the help window iteself[](#l1.21)
@@ -566,11 +572,13 @@ class EditorWindow(object): configDialog.ConfigExtensionsDialog(self.top) def help_dialog(self, event=None):
"Handle help doc event."[](#l1.27)
# edit maxosxSupport.overrideRootMenu.help_dialog to match[](#l1.28) if self.root:[](#l1.29) parent = self.root[](#l1.30) else:[](#l1.31) parent = self.top[](#l1.32)
helpDialog.display(parent, near=self.top)[](#l1.33)
help.show_idlehelp(parent)[](#l1.34)
def python_docs(self, event=None): if sys.platform[:3] == 'win': @@ -1717,4 +1725,4 @@ def _editor_window(parent): # htest # if name == 'main': from idlelib.idle_test.htest import run
--- a/Lib/idlelib/help.txt +++ b/Lib/idlelib/help.txt @@ -1,3 +1,7 @@ +This file, idlelib/help.txt is out-of-date and no longer used by Idle. +It is deprecated and will be removed in the future, possibly in 3.6 +---------------------------------------------------------------------- + [See the end of this file for ** TIPS ** on using IDLE !!] File Menu:
--- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -194,13 +194,6 @@ GetKeysDialog_spec = { "should open that file \nin a new EditorWindow." } -_help_dialog_spec = {
- 'file': 'EditorWindow',
- 'kwds': {},
- 'msg': "If the help text displays, this works.\n"
"Text is selectable. Window is scrollable."[](#l3.11)
- }
- _io_binding_spec = { 'file': 'IOBinding', 'kwds': {}, @@ -279,6 +272,13 @@ GetKeysDialog_spec = { "Right clicking an item will display a popup." } +show_idlehelp_spec = {
- 'file': 'help',
- 'kwds': {},
- 'msg': "If the help text displays, this works.\n"
"Text is selectable. Window is scrollable."[](#l3.25)
- }
+ _stack_viewer_spec = { 'file': 'StackViewer', 'kwds': {},
--- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosxSupport.py @@ -170,9 +170,8 @@ def overrideRootMenu(root, flist): configDialog.ConfigDialog(root, 'Settings') def help_dialog(event=None):
from idlelib import textView[](#l4.7)
fn = path.join(path.abspath(path.dirname(__file__)), 'help.txt')[](#l4.8)
textView.view_file(root, 'Help', fn)[](#l4.9)
from idlelib import help[](#l4.10)
help.show_idlehelp(root)[](#l4.11)
root.bind('<>', about_dialog) root.bind('<>', config_dialog)