Viewing 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
Back to Directory File Manager