ó {fc@s„dZddlTddlZdefd„ƒYZedkr€ddlZejddd d eƒdd l 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 t borderwidthitheighttwidthtWM_DELETE_WINDOWs+%d+%diidN(tToplevelt__init__t configuret resizabletFALSEttitlet transienttgrab_settprotocoltCanceltparenttmessaget used_namestcreate_widgetstwithdrawtupdate_idletaskst messageInfotconfigt frameMaintwinfo_reqwidthtgeometryt winfo_rootxt winfo_widtht winfo_rootyt winfo_heighttwinfo_reqheightt deiconifyt wait_window(tselfRR RRt_htest((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pyR s,           0 c Csˆt|jƒ|_t|jƒ|_t|dddtƒ|_|jjdtdt dt ƒt |jdt dt d d d d d |jƒ|_t|jd |jddƒ}|jƒ|jjd d d d ƒ|jd d d d ƒt|d dƒ}|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((s7/usr/lib64/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. R s 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((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pytname_ok=s   cCs6|jƒ}|r2||_|jƒ|jƒndS(N(RKtresultt grab_releasetdestroy(R"teventR1((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pyR.Os    cCs!d|_|jƒ|jƒdS(NRE(RLRMRN(R"RO((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pyRUs  N( t__name__t __module__tFalseRRRKtNoneR.R(((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pyR s     t__main__s"idlelib.idle_test.test_config_namet verbosityitexit(trun( t__doc__tTkinterRHRRRPtunittesttmainRRtidlelib.idle_test.htestRW(((s7/usr/lib64/python2.7/idlelib/configSectionNameDialog.pyts  Q