AlkantarClanX12

Your IP : 3.145.164.47


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



��Yf��@s�dZddlTddljZGdd�de�Zedkr�ddlZej	ddd	d
d�ddl
mZee�dS)
a
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
The 'return value' for the dialog, used two placed in configDialog.py,
is the .result attribute set in the Ok and Cancel methods.
�)�*Nc@sUeZdZddd�Zdd�Zdd�Zdd	d
�Zddd�ZdS)
�GetCfgSectionNameDialogFcCsAtj||�|jdd�|jdtdt�|j|�|j|�|j�|jd|j	�||_
||_||_|j
�|j�|j�|jjd|jj��|jd|j�|j�d|j�d|j�|s|j�d|j�dndf�|j�|j�d	S)
z�
        message - string, informational message to display
        used_names - string collection, names already in use for validity check
        _htest - bool, change box location when running htest
        �borderwidth�Zheight�widthZWM_DELETE_WINDOWz+%d+%d��dN)�Toplevel�__init__Z	configureZ	resizableZFALSE�titleZ	transientZgrab_setZprotocol�Cancel�parent�message�
used_names�create_widgetsZwithdrawZupdate_idletasks�messageInfo�config�	frameMainZwinfo_reqwidthZgeometryZwinfo_rootxZwinfo_widthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ	deiconifyZwait_window)�selfr
rrrZ_htest�r�D/opt/alt/python35/lib64/python3.5/idlelib/configSectionNameDialog.pyr
s,


			


		0
z GetCfgSectionNameDialog.__init__cCs�t|j�|_t|j�|_t|dddt�|_|jjdtdt	dt
�t|jdtdt
d	d
dd
d|j�|_t|jd
|jdd�}|j�|jjd	d
dd
�|jd	d
dd
�t|dd�}|jdt�t|ddddd|j�|_|jjdt
d	d
�t|ddddd|j�|_|jjdtd	d
�dS)NrrZreliefZside�expandZfillZanchorZjustifyZpadxrZpady�textZtextvariabler��Ok�Zcommandr)Z	StringVarr
�nameZfontSizeZFrameZSUNKENrZpackZTOPZTRUEZBOTHZMessage�WZLEFTrrZEntryZ	focus_setZBOTTOMZButtonrZbuttonOkrZbuttonCancelZRIGHT)rZ	entryNameZframeButtonsrrrr+s$
z&GetCfgSectionNameDialog.create_widgetscCs�|jj�j�}|s:tjddddd|�nlt|�dkrutjdddddd|�d	}n1||jkr�tjdddd
d|�d	}|S)z� After stripping entered name, check that it is a  sensible
        ConfigParser file section name. Return it if it is, '' if not.
        rz
Name ErrorrzNo name specified.r
rz)Name too long. It should be no more than z30 characters.�zThis name is already in use.)r�get�strip�tkMessageBoxZ	showerror�lenr)rrrrr�name_ok@s	
zGetCfgSectionNameDialog.name_okNcCs)|j�}|r%||_|j�dS)N)r#�result�destroy)r�eventrrrrrSs	zGetCfgSectionNameDialog.OkcCsd|_|j�dS)Nr)r$r%)rr&rrrrYs	zGetCfgSectionNameDialog.Cancel)�__name__�
__module__�__qualname__r
rr#rrrrrrr
s
 r�__main__z"idlelib.idle_test.test_config_name�	verbosityr�exitF)�run)�__doc__ZtkinterZtkinter.messageboxZ
messageboxr!r	rr'Zunittest�mainZidlelib.idle_test.htestr-rrrr�<module>s
S