Your IP : 3.147.86.30


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/configHelpSourceEdit.cpython-35.opt-2.pyc



���]��@s�ddlZddlZddlTddljZddljZGdd�de	�Z
edkr�ddlZej
dddd	d
�ddlmZee
�dS)�N)�*c@sseZdZddddd�Zdd�Zdd�Zd	d
�Zdd�Zd
dd�Zd
dd�Z	d
S)�GetHelpSourceDialog�FcCsOtj||�|jdd�|jdtdt�|j|�|j|�|j�|jd|j	�||_
d|_|j�|j
j|�|jj|�|j�|j�|jd|j�|j�d|j�d|j�|s|j�d|j�dndf�|j�|jd	|j�|j�dS)
N�borderwidth�Zheight�widthZWM_DELETE_WINDOWz+%d+%d��z<Return>)�Toplevel�__init__Z	configureZ	resizable�FALSE�titleZ	transientZgrab_set�protocol�cancel�parent�result�create_widgets�menu�set�pathZwithdrawZupdate_idletasksZgeometryZwinfo_rootxZwinfo_widthZwinfo_reqwidthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ	deiconify�bind�okZwait_window)�selfrr
ZmenuItemZfilePathZ_htest�r�9/opt/alt/python35/lib64/python3.5/configHelpSourceEdit.pyrs.	


		


		0
zGetHelpSourceDialog.__init__c
Csmt|�|_t|�|_t|�|_t|dddt�|_|jjdtdt	dt
�t|jdtdt
d	d
�}t|jd|jdd
�|_|jj�t|jdtdt
d	d�}t|jd|jdd�|_|jj�|jdtdddd�|jjdtdddd�|jdtdddd�|jjdtdddd�t|jd	dddd|j�}|jdd�t|�}|jdtdt�t|d	ddddtd|j�|_|jjdddddddd�t|d	dddd|j�|_|jjdddddddd�dS)NrrZreliefZside�expand�fillZanchorZjustify�textz
Menu Item:Ztextvariabler�z,Help File Path: Enter URL or browse for file�(ZpadxrZpady�ZBrowse�ZcommandZOK�default�rowr�columnZCancel�)Z	StringVarrrZfontSizeZFrameZGROOVEZ	frameMain�packZTOP�TRUEZBOTHZLabel�WZLEFTZEntry�	entryMenu�	focus_set�	entryPathZButton�browse_fileZBOTTOM�XZACTIVErZbuttonOkZgridrZbuttonCancel)rZ	labelMenuZ	labelPathZbrowseButtonZframeButtonsrrrr/s<	
	
%z"GetHelpSourceDialog.create_widgetscCs�dddddg}|jj�}|rEtjj|�\}}npd}tjdd�d
kr�tjjtjjtj�d�}tjj	|�s�tj
�}ntj
�}tjd|d|�}|j
d|d|�}|r�|jj|�dS)N�
HTML Files�*.htm *.html�TEXT�	PDF Files�*.pdf�Windows Help Files�*.chm�
Text Files�*.txt�	All Filesrr �winZDocr�	filetypesZ
initialdirZinitialfile)r.r/r0)r1r2r0)r3r4)r5r6r0)r7r)r�get�os�split�sys�platform�join�dirname�
executable�isdir�getcwd�tkFileDialogZOpenZshowr)rr9r�dir�baseZ
opendialog�filerrrr,Os$	$zGetHelpSourceDialog.browse_filecCs�d}|jj�}|j�|sWtjddddd|�|jj�d}nAt|�dkr�tjdddd	d|�|jj�d}|S)
NTr
zMenu Item Error�messagezNo menu item specifiedrFrz(Menu item too long:
Limit 30 characters.)rr:�strip�tkMessageBox�	showerrorr)r*�len)r�menu_okrrrrrMfs 

	
zGetHelpSourceDialog.menu_okcCs�d}|jj�}|j�|sWtjddddd|�|jj�d}ny|jd
�ring|dd
�dkr�|d
d�}tjj	|�s�tjddddd|�|jj�d}|S)NTr
zFile Path ErrorrHzNo help file path specified.rF�www.�httprzfile:zHelp file path does not exist.)rNrO)
rr:rIrJrKr+r*�
startswithr;�exists)r�path_okrrrrrRzs(

	
zGetHelpSourceDialog.path_okNcCs�|j�r�|j�r�|jj�j�|jj�j�f|_tjdkr�|jd}|j	d�rsn#t
|j�|_d||jd<|j�dS)	N�darwinr%�www�file:�http:�https:zfile://)rTrUrVrW)rMrRrr:rIrrr=r>rP�list�destroy)r�eventrrrrr�s
zGetHelpSourceDialog.okcCsd|_|j�dS)N)rrY)rrZrrrr�s	zGetHelpSourceDialog.cancel)
�__name__�
__module__�__qualname__rrr,rMrRrrrrrrr
s$ r�__main__z"idlelib.idle_test.test_config_help�	verbosityr�exitF)�run)r;r=�tkinterZtkinter.messageboxZ
messageboxrJZtkinter.filedialogZ
filedialogrDr
rr[Zunittest�mainZidlelib.idle_test.htestrarrrr�<module>s
�


?>