File "help.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/help.cpython-34.pyc
File size: 9.52 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e f%@sNdZddlmZddlmZmZmZmZmZddl	m
Z
mZmZm
Z
mZmZmZddl	mZddlmZdZerddlmZnGd	d
d
eZGddde
ZGd
ddeZGdddeZddZddZedkrJddlmZeendS)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 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)abspathdirnameisdirisfilejoin)TkToplevelFrameText	ScrollbarMenu
Menubutton)font)idleConfF)rc@sUeZdZdZddZdddZddZd	d
ZddZd
S)
HelpParserzRender 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.
    cCstj|dd||_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_g|_d|_
dS)NZconvert_charrefsTFr)r__init__texttagschartagsshowhdrlinklevelprehprefix	nested_dl
simplelisttocheader)selfrr!1/opt/alt/python34/lib64/python3.4/idlelib/help.pyr1s											zHelpParser.__init__cCs>|j|7_|jdkr$dndt|j|_dS)Nrrl)rstrr)r amtr!r!r"indent@szHelpParser.indentcCsd}x)|D]!\}}|dkr
|}q
q
Wd}|dkr\|dkr\d|_nD|dkr|dkrd|_n |dkr|d	krd
}n|dkr|dkrd|_n|dkr|d
krd|_n|dkrd|_n|d#krJ|jdd$kr4d}d|_n	d|_|jnV|dkrt|jdkrd|_qn,|dkr|jrdnd}n|dkr|jsd
nd}d|_n|dkr|jd}n|dkr$d|_|jr|jj	dd
nd|_
n||dkrH|dkrHd|_nX|dkr`||_
n@|d%kr|jrd|_|jj	dd
n||_
n|jr|jj	d||j
|jfnd"S)&zHandle starttags in help.html.rclassZdivZsectionTZ
sphinxsidebarFpfirstz

spanrZversionmodifiedemulolZsimpler#
ZdlrZliz
* z

* ZdtddendpreblockaZ
headerlinkh1h2h3N)r-r.)r5r6)
rrfindrr'rrrrinsertrrr)r tagattrsZclass_r3vsr!r!r"handle_starttagDsd
		

						zHelpParser.handle_starttagcCs|dkrM|jd|jr|jj|j|jjdfqnp|dkred|_nX|d	kr}d
|_n@|dkrd
|_	d|_
n|dkr|jddndS)zHandle endtags in help.html.r4r5r6rr9r+r,rr3Frr-r0r.r&r#N)zh1zh2zh3)zspanzem)zulzddzolr7)r'rrappendrrindexrrrr)r r:r!r!r"
handle_endtagzs
	+	zHelpParser.handle_endtagcCs|jr|jr|jr"|n|jdd}|jdkrb|d|jd|_n|jd
kr|jdkr|dt|j|jkr|t|jdj}n|j	|7_	n|j
jd	||j|jfndS)z"Handle date segments in help.html.r/ r4rr5r6rNr1)zh1zh2zh3)
rrrreplacerr@rlenstriprrr9r)r datadr!r!r"handle_datas!""zHelpParser.handle_dataN)	__name__
__module____qualname____doc__rr'r>rArHr!r!r!r"r*s6rc@s.eZdZdZddZddZdS)HelpTextzDisplay help.html.c	Cs0tjddddd}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-d3t||_t|d4d5}|j	}Wd6QX|jj
|d7|d8<d6S)9z'Configure tags and feed file to parser.mainZEditorWindowwidthtypeintZheightZwrapZwordZhighlightthicknessrZpadxZborderwidthZ
TkDefaultFontZarialZ	helveticaZTkFixedFontZmonacoZcourierrr,Zitalicr4Zboldr5r6r
backgroundz#f6f6ffr2
Zlmargin1r#ZreliefZsolidz#eeffccl1Zlmargin2l22l3Kl4dencodingzutf-8NZdisabledstate)rZ	GetOptionrrfindfontZ
tag_configurerparseropenreadZfeed)	r parentfilenameZuwideZuhighZ
normalfontZ	fixedfontfcontentsr!r!r"rs0zHelpText.__init__cCsx|D]}|jddtjd|Dkrdtjd|ddd|}|jdS|jddtjd|Dkr|SqWd	S)
z4Return name of first font family derived from names.css|]}|jVqdS)N)lower).0xr!r!r"	<genexpr>sz$HelpText.findfont.<locals>.<genexpr>rootnameexistsTZfamilycss|]}|jVqdS)N)rm)rnror!r!r"rpsN)rmtkfontnamesZFontZactualZfamilies)r rurrrr!r!r"res
+zHelpText.findfontN)rIrJrKrLrrer!r!r!r"rMsrMc@s.eZdZdZddZddZdS)	HelpFramez&Display html text, scrollbar, and toc.cCstj||t||}|d|d<t|d|j}|j|d<|jddd|jddd|j|j	ddddd	d
|j	ddddd	d|j	ddddd	d
dS)NrYcommandZyscrollcommandrweightr#columnrowstickyZnwnsewns)
r
rrMryviewsetZrowconfigureZcolumnconfiguretoc_menugrid)r rirjrZscrollr!r!r"rs
%zHelpFrame.__init__c	stt|dd}t|dd}x?jjD]1\}}|jd|d|fddq1W||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)rr
rfrZadd_command)r rrZdropZlblrr!)rr"rs)
zHelpFrame.toc_menuN)rIrJrKrLrrr!r!r!r"rvsrvc@s"eZdZdZddZdS)
HelpWindowz!Display frame with rendered html.cCstj|||j||jd|jt||jdddddd|jddd|jddddS)	NZWM_DELETE_WINDOWryrrzr{r|rxr#)	r	rZwm_titleZprotocolZdestroyrvrZgrid_columnconfigureZgrid_rowconfigure)r rirjtitler!r!r"rs
%zHelpWindow.__init__N)rIrJrKrLrr!r!r!r"rsrcCsttttttddddd}ttttd}t|dG}t|d/}x%|D]}|j|jd	qyWWd
QXWd
QXtdd
S)zCCopy idle.html to idlelib/help.html, stripping trailing whitespace.ZDocZbuildZhtmlZlibraryz	idle.htmlz	help.htmlrbwbs
Nzidle.html copied to help.html)rrr__file__rgwriterstripprint)srcZdstZinnoutliner!r!r"
copy_strips
'rcCs?ttttd}t|s+dSt||ddS)z7Create HelpWindow; called from Idle Help event handler.z	help.htmlNz	IDLE Help)rrrrrr)rirjr!r!r"
show_idlehelpsr__main__)runN) rLZhtml.parserrZos.pathrrrrrZtkinterrr	r
rrr
rrrtZidlelib.configHandlerrZuse_ttkZtkinter.ttkrrMrvrrrrIZidlelib.idle_test.htestrr!r!r!r"<module>s"(4m*