JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr Yf@sdZddlTddljZGdddeZedkrddlZej ddd d d dd l m Z e edS) 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@sUeZdZdddZddZddZdd d Zdd d ZdS) GetCfgSectionNameDialogFcCsAtj|||jdd|jdtdt|j||j||j|jd|j ||_ ||_ ||_ |j |j|j|jjd|jj|jd|j|jd|jd|j|s|jd|jdndf|j|jd 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 borderwidthZheightwidthZWM_DELETE_WINDOWz+%d+%ddN)Toplevel__init__Z configureZ resizableZFALSEtitleZ transientZgrab_setZprotocolCancelparentmessage used_namescreate_widgetsZwithdrawZupdate_idletasks messageInfoconfig frameMainZwinfo_reqwidthZgeometryZ winfo_rootxZ winfo_widthZ winfo_rootyZ winfo_heightZwinfo_reqheightZ deiconifyZ wait_window)selfr r rrZ_htestrD/opt/alt/python35/lib64/python3.5/idlelib/configSectionNameDialog.pyr s,           0 z GetCfgSectionNameDialog.__init__c Cst|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}|jdtt|d dddd|j|_|jjdt d d t|d dddd|j|_|jjdtd d dS)NrrZreliefZsideexpandZfillZanchorZjustifyZpadxrZpadytextZ textvariablerOkZcommandr )Z StringVarr nameZfontSizeZFrameZSUNKENrZpackZTOPZTRUEZBOTHZMessageWZLEFTrrZEntryZ focus_setZBOTTOMZButtonrZbuttonOkr Z buttonCancelZRIGHT)rZ entryNameZ frameButtonsrrrr+s$ z&GetCfgSectionNameDialog.create_widgetscCs|jjj}|s:tjddddd|nlt|dkrutjdddddd|d }n1||jkrtjdddd 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. r z Name ErrorrzNo name specified.r rz)Name too long. It should be no more than z30 characters.zThis name is already in use.)rgetstrip tkMessageBoxZ showerrorlenr)rrrrrname_ok@s  zGetCfgSectionNameDialog.name_okNcCs)|j}|r%||_|jdS)N)r#resultdestroy)reventrrrrrSs  zGetCfgSectionNameDialog.OkcCsd|_|jdS)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 verbosityrexitF)run) __doc__ZtkinterZtkinter.messageboxZ messageboxr!r rr'ZunittestmainZidlelib.idle_test.htestr-rrrrs S