Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/sys/lib/python2.7/idlelib/configSectionNameDialog.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�`^c@s�dZddlTddlZdefd��YZedkr�ddlZejddd	d
e�ddl	m
Z
e
e�ndS(s
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.
i�(t*NtGetCfgSectionNameDialogcBs>eZed�Zd�Zd�Zdd�Zdd�ZRS(cCsAtj||�|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(
s�
        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
        tborderwidthitheighttwidthtWM_DELETE_WINDOWs+%d+%diidN(tToplevelt__init__t	configuret	resizabletFALSEttitlet	transienttgrab_settprotocoltCanceltparenttmessaget
used_namestcreate_widgetstwithdrawtupdate_idletaskstmessageInfotconfigt	frameMaintwinfo_reqwidthtgeometrytwinfo_rootxtwinfo_widthtwinfo_rootytwinfo_heighttwinfo_reqheightt	deiconifytwait_window(tselfRRRRt_htest((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR
s,


			


		0
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(NRitrelieftsidetexpandtfilltanchortjustifytpadxitpadyttextttextvariableRitOkitcommandR(t	StringVarRtnametfontSizetFrametSUNKENRtpacktTOPtTRUEtBOTHtMessagetWtLEFTRRtEntryt	focus_settBOTTOMtButtonR.tbuttonOkRtbuttonCanceltRIGHT(R"t	entryNametframeButtons((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR)s$
cCs�|jj�j�}|s:tjddddd|�not|�dkrutjdddddd|�d	}n4||jkr�tjdddd
d|�d	}n|S(s� After stripping entered name, check that it is a  sensible
        ConfigParser file section name. Return it if it is, '' if not.
        Rs
Name ErrorRsNo name specified.Ris)Name too long. It should be no more than s30 characters.tsThis name is already in use.(R1tgettstripttkMessageBoxt	showerrortlenR(R"R1((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pytname_ok=s	
	cCs,|j�}|r(||_|j�ndS(N(RKtresulttdestroy(R"teventR1((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR.Os	cCsd|_|j�dS(NRE(RLRM(R"RN((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyRTs	N(	t__name__t
__module__tFalseRRRKtNoneR.R(((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR	s
		t__main__s"idlelib.idle_test.test_config_namet	verbosityitexit(trun(t__doc__tTkinterRHRRROtunittesttmainRQtidlelib.idle_test.htestRV(((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyt<module>s
N

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].