HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/idlelib/__pycache__/help.cpython-35.pyc


Fa*@sXdZddlmZddlmZmZmZmZmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZddlmZdZerdd	lmZGd
ddeZGdd
d
eZGdddeZGddde
ZddZddZedkrTddl m!Z!e!edS)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)abspathdirnameisdirisfilejoin)python_version)TkToplevelFrameText	ScrollbarMenu
Menubutton)font)idleConfF)rc@sUeZdZdZddZdddZddZd	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.
    cCstj|dd||_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_g|_d|_
dS)NZconvert_charrefsTFr)r__init__texttagschartagsshowhdrlinklevelprehprefix	nested_dl
simplelisttocheader)selfrr""/usr/lib/python3.5/idlelib/help.pyr4s											zHelpParser.__init__cCs>|j|7_|jdkr$dndt|j|_dS)Nrrl)rstrr)r!amtr"r"r#indentCszHelpParser.indentcCsd}x&|D]\}}|dkr
|}q
Wd}|dkrY|dkrYd|_n8|dkr}|dkr}d|_n|dkr|d	krd
}n|dkr|dkrd|_n|dkr|d
krd|_n|dkrd|_n|d#krG|jdd$kr1d}d|_n	d|_|jnJ|dkrn|jdkrd|_n#|dkr|jrdnd}n|dkr|jsd
nd}d|_n|dkr|jd}n|dkrd|_|jr|jj	dd
d|_
nv|dkr?|dkr?d|_nR|dkrW||_
n:|d%kr|jrd|_|jj	dd
||_
|jr|jj	d||j
|jfd"S)&zHandle starttags in help.html.rclassZdivZsectionTZ
sphinxsidebarFpfirstz

spanrZversionmodifiedemulolZsimpler$
ZdlrZliz
* z

* ZdtddendpreblockaZ
headerlinkh1h2h3N)r.r/)r6r7)
rrfindrr(rrrrinsertrrr )r!tagZattrsZclass_r4vsr"r"r#handle_starttagGsd
		

							zHelpParser.handle_starttagcCs|dkrJ|jd|jr|jj|j|jjdfnm|dkrbd|_nU|d	krzd
|_n=|dkrd
|_	d|_
n|dkr|jdddS)zHandle endtags in help.html.r5r6r7rr:r,r-rr4Frr.r1r/r'r$N)r5r6r7)r,r-)r.r1r/r8)r(rrappendr rindexrrrr)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|jdj}|j	|7_	|j
jd	||j|jfdS)z"Handle date segments in help.html.r0 r5rr6r7rNr2)r5r6r7)
rrrreplacerr@rlenstripr rr:r)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	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-d3t||_t|d4d5}|j	}Wd6QRX|jj
|d7|d8<d6S)9z'Configure tags and feed file to parser.mainZEditorWindowwidthtypeintZheightZwrapZwordZhighlightthicknessrZpadxZborderwidthZ
TkDefaultFontZarialZ	helveticaZTkFixedFontZmonacoZcourierrr-Zitalicr5Zboldr6r7r
backgroundz#f6f6ffr3
Zlmargin1r$ZreliefZsolidz#eeffccl1Zlmargin2l22l3Kl4dencodingzutf-8NZdisabledstate)rZ	GetOptionrrfindfontZ
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)
rrrMr
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)rrrfrZadd_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|dH}t|d/}x%|D]}|j|jd	qyWWd
QRXWd
QRXtdd
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.htmlrbwbs
Nzidle.html copied to help.html)rrr__file__rgwriterstripprint)srcZdstZinnoutliner"r"r#
copy_strips
)rcCsFttttd}t|s+dSt||dtdS)z7Create HelpWindow; called from Idle Help event handler.z	help.htmlNzIDLE Help (%s))rrrrrrr)rirjr"r"r#
show_idlehelpsr__main__)runN)"rLZhtml.parserros.pathrrrrrplatformrZtkinterr	r
rrr
rrrrtZidlelib.configHandlerrZuse_ttkZtkinter.ttkrrMrvrrrrIZidlelib.idle_test.htestrr"r"r"r#<module>s$(4o*