ž ©ÿfÚc@s¾dZddlTddljZGdd„deƒZedkrºddlZej ddd d dƒe ƒZ d d „Z ee d dƒjƒee d dde ƒjƒe jƒndS(u 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(u*NcBsV|EeZdZdd„Zdd„Zdd„Zd dd„Zd d d „Zd S( uGetCfgSectionNameDialogcCs5tj||ƒ|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( u” message - string, informational message to display used_names - string collection, names already in use for validity check u borderwidthiuheightuwidthuWM_DELETE_WINDOWu+%d+%diN(uToplevelu__init__u configureu resizableuFALSEutitleu transientugrab_setuprotocoluCanceluparentumessageu used_namesucreate_widgetsuwithdrawuupdate_idletasksu messageInfouconfigu frameMainuwinfo_reqwidthugeometryu winfo_rootxu winfo_widthu winfo_rootyu winfo_heightuwinfo_reqheightu deiconifyu wait_window(uselfuparentutitleumessageu used_names((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyu__init__ s,           $ u GetCfgSectionNameDialog.__init__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(Nu borderwidthiureliefusideuexpandufilluanchorujustifyupadxiupadyutextu textvariableuwidthiuOkiucommanduCancel(u StringVaruparentunameufontSizeuFrameuSUNKENu frameMainupackuTOPuTRUEuBOTHuMessageuWuLEFTumessageu messageInfouEntryu focus_setuBOTTOMuButtonuOkubuttonOkuCancelu buttonCanceluRIGHT(uselfu entryNameu frameButtons((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyucreate_widgets)s$ u&GetCfgSectionNameDialog.create_widgetscCs­|jjƒjƒ}|s:tjddddd|ƒnot|ƒdkrutjdddddd|ƒd }n4||jkr©tjdddd d|ƒd }n|S( u‹ After stripping entered name, check that it is a sensible ConfigParser file section name. Return it if it is, '' if not. utitleu Name ErrorumessageuNo name specified.uparentiu)Name too long. It should be no more than u30 characters.uuThis name is already in use.(unameugetustripu tkMessageBoxu showerrorulenu used_names(uselfuname((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyuname_ok>s   uGetCfgSectionNameDialog.name_okcCs,|jƒ}|r(||_|jƒndS(N(uname_okuresultudestroy(uselfueventuname((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyuOkQs  uGetCfgSectionNameDialog.OkcCsd|_|jƒdS(Nu(uresultudestroy(uselfuevent((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyuCancelWs uGetCfgSectionNameDialog.CancelN( u__name__u __module__u __qualname__u__init__ucreate_widgetsuname_okuNoneuOkuCancel(u __locals__((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyuGetCfgSectionNameDialog s    uGetCfgSectionNameDialogu__main__u"idlelib.idle_test.test_config_nameu verbosityiuexitcCs)ttdddhƒ}t|jƒdS(NuGet Nameu–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]uabc(uGetCfgSectionNameDialogurootuprinturesult(udlg((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyurunas  urunutextuuClick to begin dialog testucommandF(u__doc__utkinterutkinter.messageboxu messageboxu tkMessageBoxuTopleveluGetCfgSectionNameDialogu__name__uunittestumainuFalseuTkurooturunuMessageupackuButtonumainloop(((uD/opt/alt/python33/lib64/python3.3/idlelib/configSectionNameDialog.pyus Q