ó ,§Rc@s¸dZddlTddlZdefd„ƒYZedkr´ddlZejddd d eƒe ƒZ d „Z e e d d ƒj ƒee d dde ƒj ƒe jƒ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;eZd„Zd„Zd„Zdd„Zdd„ZRS(cCs5tj||ƒ|jddƒ|jdtdtƒ|j|ƒ|j|ƒ|jƒ|jd|j ƒ||_ ||_ ||_ |j ƒ|jƒ|jƒ|jjd|jjƒƒ|jd|jƒ|jƒd|jƒd|jƒ|jƒd|jƒdfƒ|jƒ|jƒdS( s” message - string, informational message to display used_names - string collection, names already in use for validity check t borderwidthitheighttwidthtWM_DELETE_WINDOWs+%d+%diN(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 RR((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pyR s,           $ 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((s@/opt/freeware/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.(R0tgettstript tkMessageBoxt showerrortlenR(R"R0((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pytname_ok;s   cCs,|jƒ}|r(||_|jƒndS(N(RJtresulttdestroy(R"teventR0((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pyR-Ms  cCsd|_|jƒdS(NRD(RKRL(R"RM((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pyRRs N(t__name__t __module__RRRJtNoneR-R(((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pyR s     t__main__s"idlelib.idle_test.test_config_namet verbosityitexitcCs$ttdddhƒ}|jGHdS(NsGet Names–After the text entered with [Ok] is stripped, , 'abc', or more that 30 chars are errors. Close with a valid entry (printed), [Cancel], or [X]tabc(RtrootRK(tdlg((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pytrun[s  R+RDsClick to begin dialog testR.(t__doc__tTkinterRGRRRNtunittesttmaintFalsetTkRURWR8R4R>tmainloop(((s@/opt/freeware/lib64/python2.7/idlelib/configSectionNameDialog.pyts  L