mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
16ad5cfad3
commit
5d46ab1274
6 changed files with 927 additions and 12 deletions
|
@ -21,6 +21,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
|
||||
|
@ -42,6 +43,11 @@ def _sphinx_version():
|
|||
class HelpDialog(object):
|
||||
|
||||
def __init__(self):
|
||||
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)
|
||||
self.parent = None # parent of help window
|
||||
self.dlg = None # the help window iteself
|
||||
|
||||
|
@ -539,11 +545,13 @@ class EditorWindow(object):
|
|||
configDialog.ConfigExtensionsDialog(self.top)
|
||||
|
||||
def help_dialog(self, event=None):
|
||||
"Handle help doc event."
|
||||
# edit maxosxSupport.overrideRootMenu.help_dialog to match
|
||||
if self.root:
|
||||
parent = self.root
|
||||
else:
|
||||
parent = self.top
|
||||
helpDialog.display(parent, near=self.top)
|
||||
help.show_idlehelp(parent)
|
||||
|
||||
def python_docs(self, event=None):
|
||||
if sys.platform[:3] == 'win':
|
||||
|
@ -1716,4 +1724,4 @@ def _editor_window(parent): # htest #
|
|||
|
||||
if __name__ == '__main__':
|
||||
from idlelib.idle_test.htest import run
|
||||
run(_help_dialog, _editor_window)
|
||||
run(_editor_window)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue