Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/idlelib/__pycache__/help.cpython-37.opt-2.pyc

B

YI~d�-�@s�ddlmZddlmZmZmZmZddlmZddl	m
Z
mZmZm
Z
ddlmZmZddl	mZddlmZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de
�Zdd�Zdd�Zedkr�ddlmZedddd�ddlmZee�dS)�)�
HTMLParser)�abspath�dirname�isfile�join)�python_version)�Toplevel�Frame�Text�Menu)�
Menubutton�	Scrollbar)�font)�idleConfc@s6eZdZdd�Zd
dd�Zdd�Zdd	�Zd
d�ZdS)�
HelpParsercCs`tj|dd�||_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_g|_d|_
d|_dS)NT)Zconvert_charrefs�Fr)r�__init__�text�tags�chartags�show�hdrlink�level�pre�hprefix�	nested_dl�
simplelist�toc�header�prevtag)�selfr�r!�1/opt/alt/python37/lib64/python3.7/idlelib/help.pyr3szHelpParser.__init__�cCs0|j|7_|jdkrdndt|j�|_dS)Nrr�l)r�strr)r Zamtr!r!r"�indentCszHelpParser.indentcCs>d}x|D]\}}|dkr
|}q
Wd}|dkr@|dkr@d|_�n�|dkrZ|dkrZd|_�n�|dkr�|jr�|jd	s�|j�d
d�}|r�|��s�dnd
}�nx|dkr�|dkr�d|_�n^|dkr�|dkr�d|_�nD|dkr�d|_�n2|dk�r|�d�dk�rd
}d|_nd|_|��n�|dk�r2|j	d	k�rd|_
n�|dk�rN|j�rHdnd}n�|dk�rp|j
�sddnd
}d|_
n�|dk�r�|��d
}n�|dk�r�d|_|j�r�|j�dd�d|_
nZ|dk�r�|dk�r�d|_n>|dk�r�||_
n,|d k�r|j�r
d|_|j�dd�||_
|j�r0|j�d||j
|jf�d|f|_dS)!Nr�classZdiv�sectionTZ
sphinxsidebarF�przend-1c linestartzend-1cz

�
�spanrZversionmodified�em)�ul�olZsimple���ZdlZliz
* z

* Zdt�dd�end�preblock�aZ
headerlink�h1)�h2�h3)rrr�get�isspacer�findrr&rrr�insertrrr)r �tagZattrs�class_r3�v�sZlastliner!r!r"�handle_starttagHsh













zHelpParser.handle_starttagcCs�|dkrP|jrH|dkrdn|dkr&dnd}|j�||j|j�d�f�d|_nH|dkr`d|_n8|d	krpd
|_n(|dkr�d
|_	d|_n|dkr�|�
d
�d
|f|_dS)N)r4r5r6r6z        r5z    rr:)r+r,r3Fr)r-r0r.r/)rr�appendrr�indexrrrrr&r)r r;r&r!r!r"�
handle_endtag�s"
zHelpParser.handle_endtagcCs�|jr�|js�|jr|n
|�dd�}|jdkr`y|d|�d��|_Wntk
r^d|_YnX|jdkr�|jdkr�|dt|j��|jkr�|t|j�d�}|j	|�
�7_	|j�d||j|j
f�dS)Nr*� r4rr)r4r5r6r1)rrr�replacerrAr�
ValueError�lenr�striprr:r)r �data�dr!r!r"�handle_data�s


zHelpParser.handle_dataN)r#)�__name__�
__module__�__qualname__rr&r?rBrJr!r!r!r"r*s
	
:rc@seZdZdd�Zdd�ZdS)�HelpTextc	
Csvtjddddd�}tjddddd�}d|d}tj||d	d
dd
||d�|�d
ddg�}|�dddg�}|df|d<|jd|ddfd�|jd|ddfd�|jd|ddfd�|jd|ddfd�|jd|dfd d!�|jd"|d#fd$d%d&d'd(�|jd)d$d$d*�|jd+d,d,d*�|jd-d.d.d*�|jd/d0d0d*�t|�|_t|d1d2��}|�	�}WdQRX|j�
|�d3|d4<dS)5N�mainZEditorWindow�width�int)�type�height��Zwordr�)�wrapZhighlightthicknessZpadx�borderwidthrPrSZ
TkDefaultFontZarialZ	helveticaZTkFixedFontZmonacoZcourier�rr,Zitalic)rr4�Zboldr5�r6�rz#f6f6ff)r�
backgroundr2�
�r#Zsolidz#eeffcc)r�lmargin1rXZreliefr]�l1)r`Zlmargin2�l2�2�l3�K�l4�dzutf-8)�encodingZdisabled�state)rZ	GetOptionr
r�findfontZ
tag_configurer�parser�open�readZfeed)	r �parent�filenameZuwideZuhighZ
normalfontZ	fixedfont�f�contentsr!r!r"r�s0
zHelpText.__init__cCsnxh|D]`}|��dd�tj|d�D�krDtj|d|d�}|��dS|��dd�tj|d�D�kr|SqWdS)Ncss|]}|��VqdS)N)�lower)�.0�xr!r!r"�	<genexpr>�sz$HelpText.findfont.<locals>.<genexpr>)�rootT)�name�existsrvZfamilycss|]}|��VqdS)N)rr)rsrtr!r!r"ru�s)rr�tkfont�namesZFont�actualZfamilies)r rzrwrr!r!r"rj�s
zHelpText.findfontN)rKrLrMrrjr!r!r!r"rN�srNc@seZdZdd�Zdd�ZdS)�	HelpFramecCs�t�||�t||�|_}|d|d<|�|�|_}t||jd�|_}|j	|d<|j
ddd�|jddd�|jdddd�|jddd	d�|jdd
dd�dS)Nr])�commandZyscrollcommandrr#)�weightZnw)�row�column�sticky�nsew��ns)
r	rrNr�toc_menurr
�yview�scroll�setZrowconfigureZcolumnconfigure�grid)r rnrorrr�r!r!r"r�s
zHelpFrame.__init__csTt|dd�}t|dd�}x.�jjD]"\}}|j||f�fdd�	d�q"W||d<|S)	NZTOC)rF)Ztearoffcs
��|�S)N)r�)�dex)rr!r"�<lambda>��z$HelpFrame.toc_menu.<locals>.<lambda>)Zlabelr}Zmenu)rrrkrZadd_command)r rrZdropZlblr�r!)rr"r��szHelpFrame.toc_menuN)rKrLrMrr�r!r!r!r"r|�sr|c@seZdZdd�ZdS)�
HelpWindowcCsZt�||�|�|�|�d|j�t||�jdddd�|jddd�|jddd�dS)NZWM_DELETE_WINDOWrr�)r�rr�r#)r~)	rrZwm_titleZprotocolZdestroyr|r�Zgrid_columnconfigureZgrid_rowconfigure)r rnro�titler!r!r"r�s
zHelpWindow.__init__N)rKrLrMrr!r!r!r"r��sr�c
Cs�tttttt����ddddd�}tttt��d�}t|d��<}t|d��&}x|D]}|�|��d	�qRWWdQRXWdQRXt|�d
|���dS)NZDocZbuildZhtmlZlibraryz	idle.htmlz	help.html�rb�wb�
z copied to )rrr�__file__rl�write�rstrip�print)�src�dstZinn�out�liner!r!r"�
copy_strip�s
*r�cCs4tttt��d�}t|�sdSt||dt��dS)Nz	help.htmlzIDLE Help (%s))rrrr�rr�r)rnror!r!r"�
show_idlehelpsr��__main__)rOzidlelib.idle_test.test_helpr�F)�	verbosity�exit)�runN) Zhtml.parserrZos.pathrrrr�platformrZtkinterrr	r
rZtkinter.ttkrr
rryZidlelib.configrrrNr|r�r�r�rKZunittestrOZidlelib.idle_test.htestr�r!r!r!r"�<module>s"~* 

Hacked By AnonymousFox1.0, Coded By AnonymousFox