[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.145.199.113: ~ $


��Yf�*�@sXdZddlmZddlmZmZmZmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZddlmZdZer�dd	lmZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de
�Zdd�Zdd�ZedkrTddl m!Z!e!e�dS)a help.py: Implement the Idle help menu.
Contents are subject to revision at any time, without notice.


Help => About IDLE: diplay About Idle dialog

<to be moved here from aboutDialog.py>


Help => IDLE Help: Display help.html with proper formatting.
Doc/library/idle.rst (Sphinx)=> Doc/build/html/library/idle.html
(help.copy_strip)=> Lib/idlelib/help.html

HelpParser - Parse help.html and render to tk Text.

HelpText - Display formatted help.html.

HelpFrame - Contain text, scrollbar, and table-of-contents.
(This will be needed for display in a future tabbed window.)

HelpWindow - Display HelpFrame in a standalone window.

copy_strip - Copy idle.html to help.html, rstripping each line.

show_idlehelp - Create HelpWindow.  Called in EditorWindow.help_dialog.
�)�
HTMLParser)�abspath�dirname�isdir�isfile�join)�python_version)�Tk�Toplevel�Frame�Text�	Scrollbar�Menu�
Menubutton)�font)�idleConfF)rc@sUeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�
HelpParsera~Render help.html into a text widget.

    The overridden handle_xyz methods handle a subset of html tags.
    The supplied text should have the needed tag configurations.
    The behavior for unsupported tags, such as table, is undefined.
    If the tags generated by Sphinx change, this class, especially
    the handle_starttag and handle_endtags methods, might have to also.
    cCs�tj|dd�||_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_g|_d|_
dS)NZconvert_charrefsT�Fr)r�__init__�text�tags�chartags�show�hdrlink�level�pre�hprefix�	nested_dl�
simplelist�toc�header)�selfr�r"�1/opt/alt/python35/lib64/python3.5/idlelib/help.pyr4s											zHelpParser.__init__�cCs>|j|7_|jdkr$dndt|j�|_dS)Nrr�l)r�strr)r!�amtr"r"r#�indentCszHelpParser.indentcCs�d}x&|D]\}}|dkr
|}q
Wd}|dkrY|dkrYd|_n8|dkr}|dkr}d|_n|dkr�|d	kr�d
}n�|dkr�|dkr�d|_n�|dkr�|d
kr�d|_n�|dkr�d|_n�|d#krG|jd�d$kr1d}d|_n	d|_|j�nJ|dkrn|jdkr�d|_n#|dkr�|jr�dnd}n�|dkr�|js�d
nd}d|_n�|dkr�|j�d}n�|dkrd|_|jr|jj	dd
�d|_
nv|dkr?|dkr?d|_nR|dkrW||_
n:|d%kr�|jr�d|_|jj	dd
�||_
|jr�|jj	d||j
|jf�d"S)&zHandle starttags in help.html.r�classZdivZsectionTZ
sphinxsidebarF�p�firstz

�spanrZversionmodified�em�ul�olZsimpler$�
ZdlrZliz
* z

* Zdt�dd�end�preblock�aZ
headerlink�h1�h2�h3N)r.r/���)r6r7)
rr�findrr(rrrr�insertrrr )r!�tagZattrsZclass_r4�v�sr"r"r#�handle_starttagGsd
		

							zHelpParser.handle_starttagcCs�|dkrJ|jd�|jr�|jj|j|jjd�f�nm|dkrbd|_nU|d	krzd
|_n=|dkr�d
|_	d|_
n|dkr�|jdd�dS)zHandle endtags in help.html.r5r6r7rr:r,r-rr4Frr.r1r/r'r$N)r5r6r7)r,r-)r.r1r/r8)r(rr�appendr r�indexrrrr)r!r;r"r"r#�
handle_endtag}s
	(	zHelpParser.handle_endtagcCs�|jr�|jr�|jr"|n|jdd�}|jdkr_|d|jd��|_|jd
kr�|jdkr�|dt|j��|jkr�|t|j�d�j�}|j	|7_	|j
jd	||j|jf�dS)z"Handle date segments in help.html.r0� r5rr6r7rNr2)r5r6r7)
rrr�replacerr@r�len�stripr rr:r)r!�data�dr"r"r#�handle_data�s!"zHelpParser.handle_dataN)	�__name__�
__module__�__qualname__�__doc__rr(r>rArHr"r"r"r#r+s6rc@s.eZdZdZdd�Zdd�ZdS)�HelpTextzDisplay help.html.c	Cs1tjddddd�}tjddddd�}d|d}tj||d	d
ddd
dddd|d|�|jdddg�}|jdddg�}|df|d<|jdd|ddf�|jdd|ddf�|jdd|ddf�|jdd|d df�|jd!d|dfd"d#�|jd$d|d%fd&d'dd(d)d*d"d+�|jd,d&d'd-d'�|jd.d&d/d-d/�|jd0d&d1d-d1�|jd2d&d3d-d3�t|�|_t|d4d5��}|j	�}Wd6QRX|jj
|�d7|d8<d6S)9z'Configure tags and feed file to parser.�mainZEditorWindow�width�type�intZheight��ZwrapZwordZhighlightthicknessrZpadx�ZborderwidthZ
TkDefaultFontZarialZ	helveticaZTkFixedFontZmonacoZcourier�rr-Zitalicr5�Zboldr6�r7�r�
backgroundz#f6f6ffr3�
Zlmargin1�r$ZreliefZsolidz#eeffcc�l1Zlmargin2�l2�2�l3�K�l4�d�encodingzutf-8NZdisabled�state)rZ	GetOptionrr�findfontZ
tag_configurer�parser�open�readZfeed)	r!�parent�filenameZuwideZuhighZ
normalfontZ	fixedfont�f�contentsr"r"r#r�s0zHelpText.__init__cCs�x�|D]�}|j�dd�tjd|�D�krdtjd|ddd|�}|j�dS|j�dd�tjd|�D�kr|SqWd	S)
z4Return name of first font family derived from names.css|]}|j�VqdS)N)�lower)�.0�xr"r"r#�	<genexpr>�sz$HelpText.findfont.<locals>.<genexpr>�root�name�existsTZfamilycss|]}|j�VqdS)N)rm)rnror"r"r#rp�sN)rm�tkfont�namesZFontZactualZfamilies)r!rurrrr"r"r#re�s
+zHelpText.findfontN)rIrJrKrLrrer"r"r"r#rM�srMc@s.eZdZdZdd�Zdd�ZdS)�	HelpFramez&Display html text, scrollbar, and toc.cCs�tj||�t||�}|d|d<t|d|j�}|j|d<|jddd�|jddd�|j|�j	ddddd	d
�|j	ddddd	d�|j	ddddd	d
�dS)NrY�commandZyscrollcommandr�weightr$�column�row�stickyZnw�nsew��ns)
rrrMr
�yview�setZrowconfigureZcolumnconfigure�toc_menu�grid)r!rirjrZscrollr"r"r#r�s
%zHelpFrame.__init__c	stt|dd�}t|dd�}x?�jjD]1\}}|jd|d|�fdd��q1W||d	<|S)
z+Create table of contents as drop-down menu.rZTOCZtearoffFZlabelrwcs
�j|�S)N)r)�dex)rr"r#�<lambda>�sz$HelpFrame.toc_menu.<locals>.<lambda>Zmenu)rrrfrZadd_command)r!rrZdropZlblr�r")rr#r��s)
zHelpFrame.toc_menuN)rIrJrKrLrr�r"r"r"r#rv�srvc@s"eZdZdZdd�ZdS)�
HelpWindowz!Display frame with rendered html.cCstj||�|j|�|jd|j�t||�jdddddd�|jddd�|jddd�dS)	NZWM_DELETE_WINDOWryrrzr{r|rxr$)	r
rZwm_titleZprotocolZdestroyrvr�Zgrid_columnconfigureZgrid_rowconfigure)r!rirj�titler"r"r#r�s
%zHelpWindow.__init__N)rIrJrKrLrr"r"r"r#r��sr�cCs�tttttt����ddddd�}tttt��d�}t|d��H}t|d��/}x%|D]}|j|j�d	�qyWWd
QRXWd
QRXtd�d
S)a_Copy idle.html to idlelib/help.html, stripping trailing whitespace.

    Files with trailing whitespace cannot be pushed to the hg cpython
    repository.  For 3.x (on Windows), help.html is generated, after
    editing idle.rst in the earliest maintenance version, with
      sphinx-build -bhtml . build/html
      python_d.exe -c "from idlelib.help import copy_strip; copy_strip()"
    After refreshing TortoiseHG workshop to generate a diff,
    check  both the diff and displayed text.  Push the diff along with
    the idle.rst change and merge both into default (or an intermediate
    maintenance version).

    When the 'earlist' version gets its final maintenance release,
    do an update as described above, without editing idle.rst, to
    rebase help.html on the next version of idle.rst.  Do not worry
    about version changes as version is not displayed.  Examine other
    changes and the result of Help -> IDLE Help.

    If maintenance and default versions of idle.rst diverge, and
    merging does not go smoothly, then consider generating
    separate help.html files from separate idle.htmls.
    ZDocZbuildZhtmlZlibraryz	idle.htmlz	help.html�rb�wbs
Nzidle.html copied to help.html)rrr�__file__rg�write�rstrip�print)�srcZdstZinn�out�liner"r"r#�
copy_strip�s
)r�cCsFtttt��d�}t|�s+dSt||dt��dS)z7Create HelpWindow; called from Idle Help event handler.z	help.htmlNzIDLE Help (%s))rrrr�rr�r)rirjr"r"r#�
show_idlehelpsr��__main__)�runN)"rLZhtml.parserrZos.pathrrrrr�platformrZtkinterr	r
rrr
rrrrtZidlelib.configHandlerrZuse_ttkZtkinter.ttkrrMrvr�r�r�rIZidlelib.idle_test.htestr�r"r"r"r#�<module>s$(4o* 

Filemanager

Name Type Size Permission Actions
AutoComplete.cpython-35.opt-1.pyc File 7.51 KB 0644
AutoComplete.cpython-35.opt-2.pyc File 5.85 KB 0644
AutoComplete.cpython-35.pyc File 7.51 KB 0644
AutoCompleteWindow.cpython-35.opt-1.pyc File 11.19 KB 0644
AutoCompleteWindow.cpython-35.opt-2.pyc File 10.46 KB 0644
AutoCompleteWindow.cpython-35.pyc File 11.25 KB 0644
AutoExpand.cpython-35.opt-1.pyc File 3.09 KB 0644
AutoExpand.cpython-35.opt-2.pyc File 2.32 KB 0644
AutoExpand.cpython-35.pyc File 3.09 KB 0644
Bindings.cpython-35.opt-1.pyc File 3.15 KB 0644
Bindings.cpython-35.opt-2.pyc File 2.68 KB 0644
Bindings.cpython-35.pyc File 3.15 KB 0644
CallTipWindow.cpython-35.opt-1.pyc File 5.24 KB 0644
CallTipWindow.cpython-35.opt-2.pyc File 4.94 KB 0644
CallTipWindow.cpython-35.pyc File 5.24 KB 0644
CallTips.cpython-35.opt-1.pyc File 5.78 KB 0644
CallTips.cpython-35.opt-2.pyc File 4.18 KB 0644
CallTips.cpython-35.pyc File 5.78 KB 0644
ClassBrowser.cpython-35.opt-1.pyc File 8.35 KB 0644
ClassBrowser.cpython-35.opt-2.pyc File 7.87 KB 0644
ClassBrowser.cpython-35.pyc File 8.35 KB 0644
CodeContext.cpython-35.opt-1.pyc File 5.98 KB 0644
CodeContext.cpython-35.opt-2.pyc File 4.87 KB 0644
CodeContext.cpython-35.pyc File 6.02 KB 0644
ColorDelegator.cpython-35.opt-1.pyc File 8.37 KB 0644
ColorDelegator.cpython-35.opt-2.pyc File 8.21 KB 0644
ColorDelegator.cpython-35.pyc File 8.37 KB 0644
Debugger.cpython-35.opt-1.pyc File 15.21 KB 0644
Debugger.cpython-35.opt-2.pyc File 15.06 KB 0644
Debugger.cpython-35.pyc File 15.21 KB 0644
Delegator.cpython-35.opt-1.pyc File 1.31 KB 0644
Delegator.cpython-35.opt-2.pyc File 1.21 KB 0644
Delegator.cpython-35.pyc File 1.31 KB 0644
EditorWindow.cpython-35.opt-1.pyc File 50.8 KB 0644
EditorWindow.cpython-35.opt-2.pyc File 49.55 KB 0644
EditorWindow.cpython-35.pyc File 50.9 KB 0644
FileList.cpython-35.opt-1.pyc File 3.5 KB 0644
FileList.cpython-35.opt-2.pyc File 3.49 KB 0644
FileList.cpython-35.pyc File 3.53 KB 0644
FormatParagraph.cpython-35.opt-1.pyc File 6.21 KB 0644
FormatParagraph.cpython-35.opt-2.pyc File 4.36 KB 0644
FormatParagraph.cpython-35.pyc File 6.21 KB 0644
GrepDialog.cpython-35.opt-1.pyc File 5.51 KB 0644
GrepDialog.cpython-35.opt-2.pyc File 5.5 KB 0644
GrepDialog.cpython-35.pyc File 5.51 KB 0644
HyperParser.cpython-35.opt-1.pyc File 7.23 KB 0644
HyperParser.cpython-35.opt-2.pyc File 5.94 KB 0644
HyperParser.cpython-35.pyc File 7.23 KB 0644
IOBinding.cpython-35.opt-1.pyc File 14.82 KB 0644
IOBinding.cpython-35.opt-2.pyc File 14.4 KB 0644
IOBinding.cpython-35.pyc File 14.82 KB 0644
IdleHistory.cpython-35.opt-1.pyc File 3.59 KB 0644
IdleHistory.cpython-35.opt-2.pyc File 2.38 KB 0644
IdleHistory.cpython-35.pyc File 3.59 KB 0644
MultiCall.cpython-35.opt-1.pyc File 16.09 KB 0644
MultiCall.cpython-35.opt-2.pyc File 13.77 KB 0644
MultiCall.cpython-35.pyc File 16.15 KB 0644
MultiStatusBar.cpython-35.opt-1.pyc File 1.89 KB 0644
MultiStatusBar.cpython-35.opt-2.pyc File 1.88 KB 0644
MultiStatusBar.cpython-35.pyc File 1.89 KB 0644
ObjectBrowser.cpython-35.opt-1.pyc File 5.38 KB 0644
ObjectBrowser.cpython-35.opt-2.pyc File 5.38 KB 0644
ObjectBrowser.cpython-35.pyc File 5.38 KB 0644
OutputWindow.cpython-35.opt-1.pyc File 4.42 KB 0644
OutputWindow.cpython-35.opt-2.pyc File 4.24 KB 0644
OutputWindow.cpython-35.pyc File 4.42 KB 0644
ParenMatch.cpython-35.opt-1.pyc File 6.3 KB 0644
ParenMatch.cpython-35.opt-2.pyc File 4.9 KB 0644
ParenMatch.cpython-35.pyc File 6.3 KB 0644
PathBrowser.cpython-35.opt-1.pyc File 4.01 KB 0644
PathBrowser.cpython-35.opt-2.pyc File 3.86 KB 0644
PathBrowser.cpython-35.pyc File 4.01 KB 0644
Percolator.cpython-35.opt-1.pyc File 3.82 KB 0644
Percolator.cpython-35.opt-2.pyc File 3.81 KB 0644
Percolator.cpython-35.pyc File 3.99 KB 0644
PyParse.cpython-35.opt-1.pyc File 10.71 KB 0644
PyParse.cpython-35.opt-2.pyc File 9.85 KB 0644
PyParse.cpython-35.pyc File 11.14 KB 0644
PyShell.cpython-35.opt-1.pyc File 47 KB 0644
PyShell.cpython-35.opt-2.pyc File 44.47 KB 0644
PyShell.cpython-35.pyc File 47.13 KB 0644
RemoteDebugger.cpython-35.opt-1.pyc File 14.17 KB 0644
RemoteDebugger.cpython-35.opt-2.pyc File 11.83 KB 0644
RemoteDebugger.cpython-35.pyc File 14.31 KB 0644
RemoteObjectBrowser.cpython-35.opt-1.pyc File 1.96 KB 0644
RemoteObjectBrowser.cpython-35.opt-2.pyc File 1.95 KB 0644
RemoteObjectBrowser.cpython-35.pyc File 1.96 KB 0644
ReplaceDialog.cpython-35.opt-1.pyc File 7.47 KB 0644
ReplaceDialog.cpython-35.opt-2.pyc File 6.8 KB 0644
ReplaceDialog.cpython-35.pyc File 7.47 KB 0644
RstripExtension.cpython-35.opt-1.pyc File 1.32 KB 0644
RstripExtension.cpython-35.opt-2.pyc File 1.24 KB 0644
RstripExtension.cpython-35.pyc File 1.32 KB 0644
ScriptBinding.cpython-35.opt-1.pyc File 6.9 KB 0644
ScriptBinding.cpython-35.opt-2.pyc File 5.54 KB 0644
ScriptBinding.cpython-35.pyc File 6.9 KB 0644
ScrolledList.cpython-35.opt-1.pyc File 5.62 KB 0644
ScrolledList.cpython-35.opt-2.pyc File 5.62 KB 0644
ScrolledList.cpython-35.pyc File 5.62 KB 0644
SearchDialog.cpython-35.opt-1.pyc File 3.69 KB 0644
SearchDialog.cpython-35.opt-2.pyc File 3.44 KB 0644
SearchDialog.cpython-35.pyc File 3.69 KB 0644
SearchDialogBase.cpython-35.opt-1.pyc File 7.51 KB 0644
SearchDialogBase.cpython-35.opt-2.pyc File 4.87 KB 0644
SearchDialogBase.cpython-35.pyc File 7.51 KB 0644
SearchEngine.cpython-35.opt-1.pyc File 7.24 KB 0644
SearchEngine.cpython-35.opt-2.pyc File 5.62 KB 0644
SearchEngine.cpython-35.pyc File 7.24 KB 0644
StackViewer.cpython-35.opt-1.pyc File 5.46 KB 0644
StackViewer.cpython-35.opt-2.pyc File 5.45 KB 0644
StackViewer.cpython-35.pyc File 5.46 KB 0644
ToolTip.cpython-35.opt-1.pyc File 3.95 KB 0644
ToolTip.cpython-35.opt-2.pyc File 3.94 KB 0644
ToolTip.cpython-35.pyc File 3.95 KB 0644
TreeWidget.cpython-35.opt-1.pyc File 15.25 KB 0644
TreeWidget.cpython-35.opt-2.pyc File 14.49 KB 0644
TreeWidget.cpython-35.pyc File 15.25 KB 0644
UndoDelegator.cpython-35.opt-1.pyc File 11.61 KB 0644
UndoDelegator.cpython-35.opt-2.pyc File 11.6 KB 0644
UndoDelegator.cpython-35.pyc File 11.61 KB 0644
WidgetRedirector.cpython-35.opt-1.pyc File 6.95 KB 0644
WidgetRedirector.cpython-35.opt-2.pyc File 3.58 KB 0644
WidgetRedirector.cpython-35.pyc File 6.95 KB 0644
WindowList.cpython-35.opt-1.pyc File 3.16 KB 0644
WindowList.cpython-35.opt-2.pyc File 3.15 KB 0644
WindowList.cpython-35.pyc File 3.16 KB 0644
ZoomHeight.cpython-35.opt-1.pyc File 1.37 KB 0644
ZoomHeight.cpython-35.opt-2.pyc File 1.36 KB 0644
ZoomHeight.cpython-35.pyc File 1.37 KB 0644
__init__.cpython-35.opt-1.pyc File 452 B 0644
__init__.cpython-35.opt-2.pyc File 141 B 0644
__init__.cpython-35.pyc File 452 B 0644
__main__.cpython-35.opt-1.pyc File 279 B 0644
__main__.cpython-35.opt-2.pyc File 198 B 0644
__main__.cpython-35.pyc File 279 B 0644
aboutDialog.cpython-35.opt-1.pyc File 5.93 KB 0644
aboutDialog.cpython-35.opt-2.pyc File 5.77 KB 0644
aboutDialog.cpython-35.pyc File 5.93 KB 0644
configDialog.cpython-35.opt-1.pyc File 48.17 KB 0644
configDialog.cpython-35.opt-2.pyc File 45.48 KB 0644
configDialog.cpython-35.pyc File 48.17 KB 0644
configHandler.cpython-35.opt-1.pyc File 26.25 KB 0644
configHandler.cpython-35.opt-2.pyc File 18.24 KB 0644
configHandler.cpython-35.pyc File 26.25 KB 0644
configHelpSourceEdit.cpython-35.opt-1.pyc File 5.77 KB 0644
configHelpSourceEdit.cpython-35.opt-2.pyc File 5.27 KB 0644
configHelpSourceEdit.cpython-35.pyc File 5.77 KB 0644
configSectionNameDialog.cpython-35.opt-1.pyc File 3.84 KB 0644
configSectionNameDialog.cpython-35.opt-2.pyc File 3.22 KB 0644
configSectionNameDialog.cpython-35.pyc File 3.84 KB 0644
dynOptionMenuWidget.cpython-35.opt-1.pyc File 2.37 KB 0644
dynOptionMenuWidget.cpython-35.opt-2.pyc File 1.99 KB 0644
dynOptionMenuWidget.cpython-35.pyc File 2.37 KB 0644
help.cpython-35.opt-1.pyc File 10.72 KB 0644
help.cpython-35.opt-2.pyc File 8.04 KB 0644
help.cpython-35.pyc File 10.72 KB 0644
idle.cpython-35.opt-1.pyc File 372 B 0644
idle.cpython-35.opt-2.pyc File 364 B 0644
idle.cpython-35.pyc File 372 B 0644
idlever.cpython-35.opt-1.pyc File 551 B 0644
idlever.cpython-35.opt-2.pyc File 320 B 0644
idlever.cpython-35.pyc File 551 B 0644
keybindingDialog.cpython-35.opt-1.pyc File 10.71 KB 0644
keybindingDialog.cpython-35.opt-2.pyc File 9.77 KB 0644
keybindingDialog.cpython-35.pyc File 10.71 KB 0644
macosxSupport.cpython-35.opt-1.pyc File 7 KB 0644
macosxSupport.cpython-35.opt-2.pyc File 5.13 KB 0644
macosxSupport.cpython-35.pyc File 7.11 KB 0644
rpc.cpython-35.opt-1.pyc File 20.34 KB 0644
rpc.cpython-35.opt-2.pyc File 17.03 KB 0644
rpc.cpython-35.pyc File 20.45 KB 0644
run.cpython-35.opt-1.pyc File 12.44 KB 0644
run.cpython-35.opt-2.pyc File 10.56 KB 0644
run.cpython-35.pyc File 12.49 KB 0644
tabbedpages.cpython-35.opt-1.pyc File 16.68 KB 0644
tabbedpages.cpython-35.opt-2.pyc File 11.79 KB 0644
tabbedpages.cpython-35.pyc File 16.68 KB 0644
textView.cpython-35.opt-1.pyc File 3.38 KB 0644
textView.cpython-35.opt-2.pyc File 2.95 KB 0644
textView.cpython-35.pyc File 3.38 KB 0644