3 § fÁŠã@sJdZddlmZmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,ddl-j.Z/ddl0j1Z2ddlm3Z3ddl4m5Z5m6Z6ddl7m8Z8ddl9m:Z:dd l;mZ>m?Z?dd l@mAZAdd lBmCZCdd lDmEZEddlFmGZGddlHmIZIddlJmKZKe6ƒZLeCeEeGeIeKfZMGdd„deƒZNdaOGdd„de%ƒZPGdd„de%ƒZQGdd„de%ƒZRGdd„de%ƒZSGdd„dƒZTeTƒZUdZVdd d!d"d#œZWd$d%„ZXGd&d'„d'e%ƒZYeZd(k�rFdd)l[m\Z\e\d*d+d,d-�dd.l]m^Z^e^eNƒdS)/aèIDLE Configuration Dialog: support user customization of IDLE by GUI Customize font faces, sizes, and colorization attributes. Set indentation defaults. Customize keybindings. Colorization and keybindings can be saved as user defined sets. Select startup options including shell/editor and default window size. Define additional help sources. Note that tab width in IDLE is currently fixed at eight due to Tk issues. Refer to comments in EditorWindow autoindent code for details. é)ÚToplevelÚListboxÚTextÚScaleÚCanvasÚ StringVarÚ BooleanVarÚIntVarÚTRUEÚFALSEÚTOPÚBOTTOMÚRIGHTÚLEFTÚSOLIDÚGROOVEÚNONEÚBOTHÚXÚYÚWÚEÚEWÚNSÚNSEWÚNWÚ HORIZONTALÚVERTICALÚANCHORÚACTIVEÚEND) ÚButtonÚ CheckbuttonÚEntryÚFrameÚLabelÚ LabelFrameÚ OptionMenuÚNotebookÚ RadiobuttonÚ ScrollbarÚStyleN)Ú messagebox)ÚidleConfÚ ConfigChanges)Ú GetKeysDialog)Ú DynOptionMenu)Úmacosx)Ú SectionNameÚ HelpSource)Ú view_text)Ú AutoComplete)Ú CodeContext)Ú ParenMatch)ÚFormatParagraph)ÚSqueezercs¢eZdZdZd%dddœdd„Zdd„Zd d „Zd d „Zd d„Zdd„Z ‡fdd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Z‡ZS)&Ú ConfigDialogzConfig dialog for IDLE. ÚF)Ú_htestÚ_utestcCsÚtj||ƒ||_|ri|_|s(|jƒ|jdd�|j|p>dƒ|jƒd}|jƒ|s\dnd}|j d|›d|›�ƒ|j ƒ|j t t d�|j |ƒ|jd |jƒ|jjjƒtjƒ|sÖ|jƒ|jƒ|jƒd S) aËShow the tabbed dialog for user configuration. Args: parent - parent of this dialog title - string which is the title of this popup dialog _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest Note: Focus set on font page fontlist. Methods: create_widgets cancel: Bound to DELETE_WINDOW protocol. é)Ú borderwidthzIDLE Preferencesééé–ú+)ÚheightÚwidthZWM_DELETE_WINDOWN)rÚ__init__ÚparentÚ instance_dictZwithdrawÚ configureÚtitleZ winfo_rootxZ winfo_rootyZgeometryÚcreate_widgetsZ resizabler Z transientZprotocolÚcancelÚfontpageÚfontlistZ focus_setÚtracersÚattachZgrab_setZ wm_deiconifyZ wait_window)ÚselfrGrJr<r=ÚxÚy©rTú9/opt/alt/python36/lib64/python3.6/idlelib/configdialog.pyrF-s*     zConfigDialog.__init__cCsÀt|ƒ|_}t|ƒ|_t||jƒ|_t|ƒ|_t|ƒ|_ |j ƒ|_ |j |jdd�|j |jdd�|j |jdd�|j |j dd�|j |j dd�|j ƒ|jtttd�|jƒjtd�d S) aÇCreate and place widgets for tabbed dialog. Widgets Bound to self: note: Notebook highpage: HighPage fontpage: FontPage keyspage: KeysPage genpage: GenPage extpage: self.create_page_extensions Methods: create_action_buttons load_configs: Load pages except for extensions. activate_config_changes: Tell editors to reload. z Fonts/Tabs)ÚtextÚ Highlightsz Keys z General Z Extensions)ÚsideÚexpandÚfill)rXN)r(ÚnoteÚHighPageÚhighpageÚFontPagerMÚKeysPageZkeyspageÚGenPageZgenpageÚcreate_page_extensionsZextpageÚaddZenable_traversalÚpackr r rÚcreate_action_buttonsr )rQr[rTrTrUrK]s    zConfigDialog.create_widgetscCs¨tjƒri}nddi}t|dd�}t|dd�}xRd|jfd|jfd|jfd |jffD]*\}}t|f||td œ|—Žj t d d �qTWt|dd d�j t d�|j t d�|S)aÑReturn frame of action buttons for dialog. Methods: ok apply cancel help Widget Structure: outer: Frame buttons: Frame (no assignment): Button (ok) (no assignment): Button (apply) (no assignment): Button (cancel) (no assignment): Button (help) (no assignment): Frame Úpaddingééé)reZOkZApplyZCancelZHelp)rVÚcommandÚ takefocusr>)rXÚpadxr)rDr?)rX)rfrg) r1ZisAquaTkr$ÚokÚapplyrLÚhelpr!r rcrr r )rQZ padding_argsZouterZbuttonsZtxtÚcmdrTrTrUrd|s   z"ConfigDialog.create_action_buttonscCs|jƒ|jƒdS)zvApply config changes, then dismiss dialog. Methods: apply destroy: inherited N)rmÚdestroy)rQrTrTrUrl¢szConfigDialog.okcCs$|jƒtjƒ|jƒ|jƒdS)z¸Apply config changes and leave dialog open. Methods: deactivate_current_config save_all_changed_extensions activate_config_changes N)Údeactivate_current_configÚchangesÚsave_allÚsave_all_changed_extensionsÚactivate_config_changes)rQrTrTrUrm¬szConfigDialog.applycCs |jƒdS)zPDismiss config dialog. Methods: destroy: inherited N)rp)rQrTrTrUrL¹szConfigDialog.cancelcs&|jjjddƒa|jƒtƒjƒdS)Nz1.0Úend)rMÚ font_sampleÚgetÚfont_sample_textZ grab_releaseÚsuperrp)rQ)Ú __class__rTrUrpÁszConfigDialog.destroycCs8|jj|jjƒdd�jƒ}t|dttj|dƒd�dS)z¤Create textview for config dialog help. Attrbutes accessed: note Methods: view_text: Method from textview module. rV)ZoptionzHelp for IDLE preferencesr;)rJrVN)r[ZtabZselectÚstripr4Ú help_commonÚ help_pagesrx)rQZpagerTrTrUrnÇs zConfigDialog.helpcCs&|jjjƒ}x|D] }|jƒqWdS)z�Remove current key bindings. Iterate over window instances defined in parent and remove the keybindings. N)rGrHÚkeysZRemoveKeybindings)rQÚ win_instancesÚinstancerTrTrUrqÔs  z&ConfigDialog.deactivate_current_configcCs\|jjjƒ}x4|D],}|jƒ|jƒ|jƒ|jƒ|jƒqWxtD] }|j ƒqHWdS)z¨Apply configuration changes to current windows. Dynamically update the current parent window instances with some of the configuration changes. N) rGrHrZResetColorizerZ ResetFontZset_notabs_indentwidthZApplyKeybindingsZreset_help_menu_entriesÚ reloadablesÚreload)rQr€r�ÚklassrTrTrUrußs    z$ConfigDialog.activate_config_changescCsh|j}t|jƒ}tjd|_tjd|_|jt ƒ|_ |j ƒt |ƒ|_ |j ddd�|jddd�t||j dd�|_|jjd|jƒt||jjd �}|j|j_t|d d d �|_|jjddd d �|jdddd �|jjdddddgd�|jdd�i|_d|_||_|j|_d}x.t|j ƒD] }|j!|ƒ|d|d}�qW|j j|ƒ|jj"dƒ|jdƒ|S)a7Part of the config dialog used for configuring IDLE extensions. This code is generic - it works for any and all IDLE extensions. IDLE extensions save their configuration options using idleConf. This code reads the current configuration using idleConf, supplies a GUI interface to change the configuration values, and saves the changes using idleConf. Not all changes take effect immediately - some may require restarting IDLE. This depends on each extension's implementation. All values are treated as text, and it is up to the user to supply reasonable values. The only exception to this are the 'enable*' options, which are boolean, and can be toggled with a True/False button. Methods: load_extensions: extension_selected: Handle selection from list. create_extension_frame: Hold widgets for one extension. set_extension_value: Set in userCfg['extensions']. save_all_changed_extensions: Call extension page Save(). Ú extensionsré)ÚweightrhZbrowse)Z listvariableZ selectmodez<>)riéú)rErDZnws)ÚcolumnÚrowÚstickyÚnsÚnsewé )r‰rŠr‹rk)reNr;ú{z} )#rGr$r[r-Ú defaultCfgÚext_defaultCfgÚuserCfgÚ ext_userCfgÚregisterÚis_intÚload_extensionsrZextension_namesÚ rowconfigureÚcolumnconfigurerÚextension_listÚbindÚextension_selectedr*ÚyviewÚsetÚyscrollcommandr&Ú details_frameÚgridrIÚ config_frameÚcurrent_extensionZ outerframeZtabbed_page_setÚsortedr…Úcreate_extension_frameZ selection_set)rQrGÚframeZscrollZ ext_namesÚext_namerTrTrUraïs>            z#ConfigDialog.create_page_extensionsc Cs^i|_xtjdd�D]}g|j|<qW�x0|jD�]$}t|jj|ƒƒ}dd„|Dƒ}x|D]}|j|ƒqZW||}xà|D]Ø}|jj||dd�}ydddœ|}d}WnBtk rèyt |ƒ}d }Wnt k râ|}d }YnXYnXy|j j|||d|d �}Wnt k �r|}YnXt |ƒ} | j t|ƒƒ|j|j||||| d œƒqzWq0Wd S) zAFill self.extensions with data from the default and user configs.F)Z active_onlycSsg|]}|jdƒr|‘qS)Úenable)Ú startswith)Ú.0Úopt_namerTrTrUú 8sz0ConfigDialog.load_extensions..T)Úraw)ÚTrueÚFalseÚboolÚintN)Útyper¬Údefault)Únamer±r²ÚvalueÚvar)r…r-Z GetExtensionsr£r‘Z GetOptionListÚremoveÚGetÚKeyErrorr°Ú ValueErrorr“rr�ÚstrÚappend) rQr¦Zopt_listZenablesrªZdef_strZdef_objZopt_typer´rµrTrTrUr–-sF      zConfigDialog.load_extensionscCsˆ|jjƒ}|r|jj|ƒ}|dks,||jkrV|jrV|jjdd�|j|jjƒd|_|r„|jj|d�|j|jdddd�||_dS)z/Handle selection of an extension from the list.Nr;)rVrr�)r‰rŠr‹) r™Ú curselectionrxr¢rŸÚconfigr¡Z grid_forgetr )rQÚeventZnewselrTrTrUr›[s  zConfigDialog.extension_selectedcCsæt|jddd�}||j|<|j}xÀt|j|ƒD]®\}}t||dd�}|j|dtd�|d}|dd krŽt ||d d d d �j|dt dd�q0|ddkrÂt ||d|j dfdd�j|dt dd�q0t ||dd�j|dt dd�q0WdS)z=Create a frame holding the widgets to configure one extensionrˆ)rDrEr³)rVr)rŠr‰r‹rµr±r¯r­r®é)ÚvariableÚonvalueÚoffvaluerEr†é)rŠr‰r‹rkr°Úkeyz%PrŽ)Ú textvariableZvalidateZvalidatecommandrEé)rÅrEN)ÚVerticalScrolledFramerŸr¡ÚinteriorÚ enumerater…r%r rr"rr#r•r)rQr¦ÚfZ entry_arearŠÚoptZlabelrµrTrTrUr¤js$    z#ConfigDialog.create_extension_framecCsX|d}|d}|djƒjƒp"|}|dj|ƒ||krH|jj||ƒS|jj|||ƒS)zŸReturn True if the configuration was added or changed. If the value is the same as the default, then remove it from user config file. r³r²rµ)rxr|r�r“Z RemoveOptionÚ SetOption)rQZsectionrËr³r²r´rTrTrUÚset_extension_value„sz ConfigDialog.set_extension_valuecCsNd}x6|jD],}|j|}x|D]}|j||ƒr d}q Wq W|rJ|jjƒdS)z£Save configuration changes to the user config file. Attributes accessed: extensions Methods: set_extension_value FTN)r…rÍr“ZSave)rQZ has_changesr¦ZoptionsrËrTrTrUrt•s      z(ConfigDialog.save_all_changed_extensions)r;)Ú__name__Ú __module__Ú __qualname__Ú__doc__rFrKrdrlrmrLrprnrqrurar–r›r¤rÍrtÚ __classcell__rTrT)r{rUr:)s"0&     >.r:u^ AaBbCcDdEeFfGgHhIiJj 1234567890#:+=(){}[] ¢£¥§©«®¶½ĞÀÃ�ÂÃÄÅÇÃ�Øß É�ɕɘɞɟɤɫɮɰɷɻÊ�ʃʆʎʞʢʫʭʯ ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκ БбДдЖжПпФфЧчЪъЭÑ�ѠѤѬӜ ×�בגדהוזחטיךכל×�מןנסעף ابجدهوزحطي٠١٢٣٤٥٦٧٨٩ ०१२३४५६७८९अआइईउऊà¤�à¤�ओऔ ௦௧௨௩௪௫௬௭௮௯அஇஉஎ 〇一二三四五六七八ä¹� 汉字漢字人木ç�«åœŸé‡‘æ°´ ê°€ëƒ�ë�”려모뵤수유즈치 ã�‚ã�„ã�†ã�ˆã�Šã‚¢ã‚¤ã‚¦ã‚¨ã‚ª csVeZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zdd d „Zdd„Z dd„Z ‡Z S)r^cs0tƒj|ƒ|j|_|jƒ|jƒ|jƒdS)N)rzrFÚhighlight_sampleÚcreate_page_font_tabÚ load_font_cfgÚ load_tab_cfg)rQÚmasterr])r{rTrUrFØs  zFontPage.__init__c Cs~tjt|ƒ|jƒ|_tjt|ƒ|jƒ|_tjt|ƒ|jƒ|_tjt|ƒd.ƒ|_ t |dt dd�}t |dt dd�}t |dt dd�}t |ƒ}t |ƒ}t |td d �}t|d d td �|_|jjd|jƒ|jjd|jƒ|jjd|jƒt|ƒ}|j|jjd�|jj|jd�t |dd�}t||jdƒ|_t||jdddd�|_t|ddd�|_|jjtt ƒt |tdd �} t!||j ddddd�|_"|j#ddd �|j$ddd!d!d"�|j$dddd!d!d#d$�|j$ddd!d!d%d&�|j%t&d!d!t'd'�|j%t&d!d!t'd'�|j%t&t(d(�|jj%tt)t'd)�|j%tt*d*�|j%tt(d(�|jj%tt(d(�|jj%tt(dd+�|jj%t)t+d,�| j%t&t(d!d+�|j"j%t&d!t'd-�dS)/açReturn frame of widgets for Font/Tabs tab. Fonts: Enable users to provisionally change font face, size, or boldness and to see the consequence of proposed choices. Each action set 3 options in changes structuree and changes the corresponding aspect of the font sample on this page and highlight sample on highlight page. Function load_font_cfg initializes font vars and widgets from idleConf entries and tk. Fontlist: mouse button 1 click or up or down key invoke on_fontlist_select(), which sets var font_name. Sizelist: clicking the menubutton opens the dropdown menu. A mouse button 1 click or return key sets var font_size. Bold_toggle: clicking the box toggles var font_bold. Changing any of the font vars invokes var_changed_font, which adds all 3 font options to changes and calls set_samples. Set_samples applies a new font constructed from the font vars to font_sample and to highlight_sample on the highlight page. Tabs: Enable users to change spaces entered for indent tabs. Changing indent_scale value with the mouse sets Var space_num, which invokes the default callback to add an entry to changes. Load_tab_cfg initializes space_num to default. Widgets for FontPage(Frame): (*) widgets bound to self frame_font: LabelFrame frame_font_name: Frame font_name_title: Label (*)fontlist: ListBox - font_name scroll_font: Scrollbar frame_font_param: Frame font_size_title: Label (*)sizelist: DynOptionMenu - font_size (*)bold_toggle: Checkbutton - font_bold frame_sample: LabelFrame (*)font_sample: Label frame_indent: LabelFrame indent_title: Label (*)indent_scale: Scale - space_num ÚmainÚIndentú num-spacesrhz Shell/Editor Font )r?ÚreliefrVz Font Sample (Editable) z Indentation Width z Font Face :)ZjustifyrVrÆT)rDrjÚexportselectionzzz)ri)ržzSize :)rVNr†rZBold)rÀrÁrÂrVr@)rErDzPython Standard: 4 Spaces!Z horizontalé)rÀÚorientZ tickintervalZfrom_Zto)r‡r>)rŠr‰rkÚpadyr�)rŠr‰Zrowspanrkrßr‹Zew)rŠr‰rkrßr‹)rXrkrßrZ)rXÚanchor)rXrYrZ)rXrZ)rXràrk)rYrZ)rXrkrZ)rØrÙrÚ),rOrbrÚvar_changed_fontÚ font_nameÚ font_sizerÚ font_boldr Ú space_numr&rr$r%rrr rNršÚon_fontlist_selectr*r½rœr�r0Úsizelistr"Z bold_togglerrwÚinsertr ryrZ indent_scaler˜r rcr rrr rr) rQZ frame_fontZ frame_sampleZ frame_indentZframe_font_nameZframe_font_paramZfont_name_titleZ scroll_fontZfont_size_titleZ indent_titlerTrTrUrÔßsh.   zFontPage.create_page_font_tabc Csôtj|ddƒ}|djƒ}|d}|ddk}ttj|ƒƒ}|jƒx|D]}|jjt |ƒqJW|j j |ƒdd„|Dƒ}y>|j |ƒ}|jj |ƒ|jj|ƒ|jj|ƒ|jj|ƒWntk rÌYnX|jjd|ƒ|jj |ƒ|jƒdS)aLoad current configuration settings for the font options. Retrieve current font with idleConf.GetFont and font families from tk. Setup fontlist and set font_name. Setup sizelist, which sets font_size. Set font_bold. Call set_samples. rØÚ EditorWindowrr†rhZboldcSsg|] }|jƒ‘qSrT)Úlower)r©ÚsrTrTrUr«^sz*FontPage.load_font_cfg..Ú7Ú8Ú9Ú10Ú11Ú12Ú13Ú14Ú16Ú18Ú20Ú22Ú25Ú29Ú34Ú40N)rìrírîrïrðrñròrórôrõrör÷rørùrúrû)r-ZGetFontrêÚlistÚtkFontZfamiliesÚsortrNrèr râr�ÚindexÚseeÚ select_setÚ select_anchorZactivater¹rçÚSetMenuräÚ set_samples) rQZconfigured_fontrârãräZfontsÚfontZlc_fontsZcurrent_font_indexrTrTrUrÕLs.         zFontPage.load_font_cfgcGsZ|jjƒ}tjddd|ƒ|jjƒ}tjddd|ƒ|jjƒ}tjddd|ƒ|jƒdS)zùStore changes to font attributes. When one font attribute changes, save them all, as they are not independent from each other. In particular, when we are overriding the default font, we need to write out everything. rØrérz font-sizez font-boldN)rârxrrÚ add_optionrãrär)rQÚparamsr´rTrTrUráos   zFontPage.var_changed_fontcCs0|jj|jjdkrtntƒ}|jj|jƒƒdS)z­Handle selecting a font from the list. Event can result from either mouse click or Up or Down key. Set font_name and example displays to selection. Z KeyReleaseN) rNrxr±r³rrrâr�rê)rQr¾rrTrTrUræ~szFontPage.on_fontlist_selectNcCsH|jjƒ}|jjƒrtjntj}||jjƒ|f}||jd<||jd<dS)zýUpdate update both screen samples with the font settings. Called on font initialization and change events. Accesses font_name, font_size, and font_bold Variables. Updates font_sample and highlight page highlight_sample. rN) rârxrärýZBOLDZNORMALrãrwrÓ)rQr¾râZ font_weightZnew_fontrTrTrUrˆs   zFontPage.set_samplescCs$tjdddddd�}|jj|ƒdS)z‘Load current configuration settings for the tab options. Attributes updated: space_num: Set to value from idleConf. rØrÙz num-spacesér°)r²r±N)r-Ú GetOptionrår�)rQrårTrTrUrÖ•szFontPage.load_tab_cfgcGs|jjƒ}tjddd|ƒdS)z!Store change to indentation size.rØrÙz num-spacesN)rårxrrr)rQrr´rTrTrUÚvar_changed_space_num s zFontPage.var_changed_space_num)N) rÎrÏrÐrFrÔrÕrárærrÖr rÒrTrT)r{rUr^Ös m#  r^cs¼eZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Z‡ZS)+r\cs2tƒj|ƒ|j|_t|ƒ|_|jƒ|jƒdS)N)rzrFr×Úcdr+ÚstyleÚcreate_page_highlightÚload_theme_cfg)rQr×)r{rTrUrF¨s   zHighPage.__init__c $sÔdsdtdudvdwdxdydzd{d|d}d~dd€d�dœˆ_tjtˆƒˆjƒˆ_tjtˆƒˆjƒˆ_tˆƒˆ_ tjtˆƒˆj ƒˆ_ tjtˆƒˆj ƒˆ_ tjtˆƒˆjƒˆ_tˆd td!d"�}tˆd td#d"�}t|td$d‚d(d)d*td+td,� }ˆ_|jd-d.d/„ƒ|jd0d1d/„ƒd¦}x$|D]}|jt|d+|d$ƒ�qWx8ˆjD].}|f‡fdLdM„ }|jˆj|d+dN|ƒ�q(WdO|dP<ˆjjdQd$dRdS�t|dQdT�ˆ_t|ƒ}tˆjdUˆj dV�ˆ_!t"ˆjˆjdWd+dX�ˆ_#t$|ˆj d$dYˆj%dZ�ˆ_&t$|ˆj d+d[ˆj%dZ�ˆ_'ˆj j(d$ƒt|d\ˆj)dV�ˆ_*t+|d]d^�} t$|ˆj d$ˆj,d_d`�ˆ_-t$|ˆj d+ˆj,dad`�ˆ_.t"|ˆjdWdWdb�ˆ_/t"|ˆjdWdWdb�ˆ_0t|dcˆj1dV�ˆ_2t+|d dd�ˆ_3|j4t5dedet6t7df�|j4t8dedet9dg�ˆjj4t8dedet6t9df�|j4t8ded+dh�ˆjj4t8dedet6t7df�ˆj!j4t8t6t9didjdk�ˆj#j4t8t6t9didldk�ˆj&j4t5t:dm�ˆj'j4t;tcSsdS)Nr#rT)ÚerTrTrUÚLsz0HighPage.create_page_highlight..z cSsdS)Nr#rT)r.rTrTrUr/MsÚ ú#you can click hereú#to choose itemsúcode context sectionú Údefú Úfuncú (param): ú """string"""ú var0 = ú'string'ú var1 = ú 'selected'ú var2 = ú'found'ú var3 = rüú(ÚNoneú) ú breakpoint("line")ú error úcursor |ú Úshellcsˆjj|ƒdS)N)Úhighlight_targetr�)r¾Úelem)rQrTrUÚtemdsz+HighPage.create_page_highlight..temzÚdisabledÚstatezframe_color_set.TFrameZsolid)r?rÛ)r zChoose Color for :)rVriN)r-Z Foreground)rÀr´rVriZ BackgroundzSave as New Custom Themez Select : )rVza Built-in Theme)rÀr´rirVza Custom Theme)rizDelete Custom Theme)r?r>)rXrkrßrYrZ)rXrkrßrZ)rXrkrßr¿r)rXrYrZrkrßrg)rXrà)rXrZrkrß)rXràrkrß)rXràrk)rXrZràrkrß)rXrZrß)rr)rr)rr)rr)rr)rr)rr)rr)rr )r!r")r#rï)r$rð)r%rñ)r&rò)r'ró)r)r*r;©r0r©r1r©r0r©r2r©r0r©r3r©r4r©r5r©r6r©r7r©r8r©r9r©r:r©r;r©r<r©r=r©r>r©r?r©r@r©rür©rAr©rBr©rCr©rDr#©r4r©rEr%©r6r©rFr!©rGr©rHr$©r6r©r&r&©r6r©r'r'©r4r)#rNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorp)>Útheme_elementsrOrbrÚvar_changed_builtin_nameÚ builtin_nameÚvar_changed_custom_nameÚ custom_namerÚ fg_bg_toggleÚvar_changed_colorÚcolorÚvar_changed_theme_sourceÚ theme_sourceÚvar_changed_highlight_targetrIr&rrrr rrÓršrèr Ztag_bindr rIr$Úframe_color_setr!Ú get_colorZbutton_set_colorr0Ú targetlistr)Úset_color_sample_bindingÚfg_onÚbg_onr�Úsave_as_new_themeZbutton_save_customr%Úset_theme_typeZbuiltin_theme_onÚcustom_theme_onÚ builtinlistÚ customlistÚ delete_customÚbutton_delete_customÚ theme_messagercrr rr rrrrr ) rQÚ frame_customZ frame_themerVZ text_and_tagsZtexttagÚelementrKZframe_fg_bg_toggleZtheme_type_titlerT)rQrUr ¯säv            zHighPage.create_page_highlightcs.ˆjjtjdddddd�ƒtjƒ}ˆjjƒr–tjddƒ}|jƒˆjj ||ƒtjddƒ}|jƒ|s‚ˆj j dƒˆj jd ƒqÞˆj j ||d ƒnHtjddƒ}|jƒˆj j ||ƒtjddƒ}|jƒˆjj ||d ƒˆjƒtˆjjƒƒ}|j‡fd d „d�ˆjj ||d ƒˆjƒˆjƒdS)aêLoad current configuration settings for the theme options. Based on the theme_source toggle, the theme is set as either builtin or custom and the initial widget values reflect the current settings from idleConf. Attributes updated: theme_source: Set from idleConf. builtinlist: List of default themes from idleConf. customlist: List of custom themes from idleConf. custom_theme_on: Disabled if there are no custom themes. custom_theme: Message with additional information. targetlist: Create menu from self.theme_elements. Methods: set_theme_type paint_theme_sample set_highlight_target rØÚThemer²r¯r†)r±r²Ú highlightÚuserrLz- no custom themes -rcsˆj|dS)Nr†)rq)rR)rQrTrUr/Ôsz)HighPage.load_theme_cfg..)rÄN)rL)rzr�r-r Z CurrentThemerxÚGetSectionListrþr…rr„rMrur†rƒrürqrr~Úpaint_theme_sampleÚset_highlight_target)rQÚcurrent_optionÚ item_listZ theme_namesrT)rQrUr¥s2       zHighPage.load_theme_cfgcGsŽd }|jjƒ}||krXtjdddƒ|krriržZxscrollcommandzGet New Keys for SelectionrL)rVrirMcsg|]}tˆddd�‘qS)rhr)rer?)r$)r©Úi)Úframe_key_setsrTrUr«­sz-KeysPage.create_page_keys..rr†zUse a Built-in Key Set)rÀr´rirVzUse a Custom Key SetN)rizDelete Custom Key Set)rVrizSave as New Custom Key Set)r?r>)rXrkrßrYrZ)rXrkrßrZ)rXrZrkrß)r‡)rŠr‰Z columnspanr‹)rŠr‰r‹)rŠr‰r‹rkrßT)rXrZrYrk)rXrZrY)rXrZrYrß)8rOrbrrrrsrtrurÚvar_changed_keyset_sourceÚ keyset_sourceÚvar_changed_keybindingÚ keybindingr&rr$r%r*rrr Ú bindingslistršÚon_bindingslist_selectrœZxviewr�r!Ú get_new_keysÚbutton_new_keysÚranger)Ú set_keys_typeZbuiltin_keyset_onÚcustom_keyset_onr0r…r†Údelete_custom_keysÚbutton_delete_custom_keysÚsave_as_new_key_setZbutton_save_custom_keysÚ keys_messagercr r rrrr˜r—r rrrrr )rQrŠZ frame_targetZ target_titleZscroll_target_yZscroll_target_xZframesrT)r¸rUrµ:s„R            zKeysPage.create_page_keyscCsü|jjtjdddddd�ƒtjƒ}|jjƒr–tjddƒ}|jƒ|jj ||ƒtjddƒ}|jƒ|s‚|j j d ƒ|j jd ƒqÞ|j j ||d ƒnHtjddƒ}|jƒ|j j ||ƒtjddƒ}|jƒ|jj |tjƒƒ|jƒtjƒ}|j|ƒd S)z?Load current configuration settings for the keybinding options.rØÚKeysr²r¯r†)r±r²rrŽrLz- no custom keys -rN)rL)rºr�r-r Z CurrentKeysrxr�rþr…rrÃrMrur†Ú default_keysrÂÚload_keys_list)rQr’r“Ú keyset_namerTrTrUr¶Ús,       zKeysPage.load_key_cfgcGs�d}|jjƒ}||krXtjdddƒ|kr|j,ƒt-|d?d@dA|j.dB�|_/t-|dCdA|j0dD�|_1t-|dEd@dA|j2dB�|_3|j4t5d9d9t6t7dF�|j4t5d9d9t6t7dF�|j4t5d9d9t6t7dF�|j4t5d9d9t6t7dF�|j4t5d9dt8dG�|j4t9t:d9d9dH�|jj4t;t:d9d9dH�|jj4t;t:d9d9dH�|j4t5d9dt8dG�|j4t9t:d9d9dH�|jj4t;tT)rDrjrÜriržzZEditrLr¿)rVrMrEriZAdd)rVrEriZRemove)rXrkrßrYrZ)rXrkrßrZ)rXràrkrßrŽ)rXràrß)rXrkrß)rXràrkrÆ)rXràrZ)rXràrYrZ)rXràN)rØrärå)rØrérE)rØrérD)r…r5ræ)r…r7r )r…r7rç)r…r7rè)rØrérê)rØrärë)r…r8rì)r…r6rí)>rOrbr Ú startup_editrÚ win_widthÚ win_heightÚautocomplete_waitÚ paren_styleÚ flash_delayrÚ paren_bellÚauto_squeeze_min_linesrëÚ format_widthÚ context_linesr&rr$r%r)Zstartup_editor_onZstartup_shell_onr#Z win_width_intZwin_height_intZ auto_wait_intr'Zparen_style_typeZparen_flash_timer"Zbell_onZ save_ask_onZ save_auto_onZformat_width_intZ context_intZauto_squeeze_min_lines_intrr Úhelplistr*rœr�ršÚhelp_source_selectedr!Úhelplist_item_editÚbutton_helplist_editÚhelplist_item_addZbutton_helplist_addÚhelplist_item_removeÚbutton_helplist_removercr r rrrrrrr)rQZ frame_windowZ frame_editorZ frame_shellZ frame_helpZ frame_runZ startup_titleZframe_win_sizeZwin_size_titleZwin_width_titleZwin_height_titleZframe_autocompleteZauto_wait_titleZ frame_paren1Zparen_style_titleZ frame_paren2Zparen_time_titleZ frame_saveZrun_save_titleZ frame_formatZformat_width_titleZ frame_contextZ context_titleZframe_auto_squeeze_min_linesZauto_squeeze_min_lines_titleZframe_helplistZframe_helplist_buttonsZscroll_helplistrTrTrUrâês*B                           zGenPage.create_page_generalcCs`|jjtjddddd�ƒ|jjtjddddd�ƒ|jjtjddd dd�ƒ|jjtjd d d dd�ƒ|jjtjd d dƒƒ|jjtjd d ddd�ƒ|j jtjd d dƒƒ|j jtjdddddd�ƒ|j jtjd dddd�ƒ|j jtjd dddd�ƒ|j jtjddddd�ƒtjƒ|_|jjddƒx"|jD]}|jjt|dƒ�q8W|jƒdS)z.default_callbackrT)rµr½rrT)r½rµrUrsszVarTrace.make_callbackcCs:x4|jr4|jjƒ\}}|jd|ƒ|jj||fƒqWdS)z0Attach callback to all vars that are not traced.ÚwriteN)r ÚpopZ trace_addr r»)rQrµrrTrTrUrP{s zVarTrace.attachcCsFx@|jr@|jjƒ\}}|jd|jƒddƒ|jj||fƒqWdS)z!Remove callback from traced vars.rrr†N)r rZ trace_removeZ trace_infor r»)rQrµrrTrTrUÚdetach‚szVarTrace.detachN) rÎrÏrÐrÑrFr rbrárrPrrTrTrTrUr Ms  r a7When you click either the Apply or Ok buttons, settings in this dialog that are different from IDLE's default are saved in a .idlerc directory in your home directory. Except as noted, these changes apply to all versions of IDLE installed on this machine. [Cancel] only cancels changes made since the last save. u Font sample: This shows what a selection of Basic Multilingual Plane unicode characters look like for the current font selection. If the selected font does not define a character, Tk attempts to find another font that does. Substitute glyphs depend on what is available on a particular system and will not necessarily have the same size as the font selected. Line contains 20 characters up to Devanagari, 14 for Tamil, and 10 for East Asia. Hebrew and Arabic letters should display right to left, starting with alef, ×� and ا. Arabic digits display left to right. The Devanagari and Tamil lines start with digits. The East Asian lines are Chinese digits, Chinese Hanzi, Korean Hangul, and Japanese Hiragana and Katakana. You can edit the font sample. Changes remain until IDLE is closed. z¨ Highlighting: The IDLE Dark color theme is new in October 2015. It can only be used with older IDLE releases if it is saved as a custom theme, with a different name. z¢ Keys: The IDLE Modern Unix key set is new in June 2016. It can only be used with older IDLE releases if it is saved as a custom key set, with a different name. a_ General: AutoComplete: Popupwait is milleseconds to wait after key char, without cursor movement, before popping up completion box. Key char is '.' after identifier or a '/' (or '\' on Windows) within a string. FormatParagraph: Max-width is max chars in lines after re-formatting. Use with paragraphs in both strings and comment blocks. ParenMatch: Style indicates what is highlighted when closer is entered: 'opener' - opener '({[' corresponding to closer; 'parens' - both chars; 'expression' (default) - also everything in between. Flash-delay is how long to highlight if cursor is not moved (0 means forever). CodeContext: Maxlines is the maximum number of code context lines to display when Code Context is turned on for an editor window. Shell Preferences: Auto-Squeeze Min. Lines is the minimum number of lines of output to automatically "squeeze". )z Fonts/TabsrWrÈräc Cs.|sdSy t|ƒdStk r(dSXdS)z(Return 's is blank or represents an int'TFN)r°r¹)rërTrTrUr•Ésr•c@seZdZdZdd„ZdS)rÇzÞA pure Tkinter vertically scrollable frame. * Use the 'interior' attribute to place widgets inside the scrollable frame * Construct and pack/place/grid normally * This frame only allows vertical scrolling csÐtj||f|ž|Žt|td�}|jtttd�t|dd|j dd�‰ˆjt t t d�|j ˆjd�ˆjdƒˆjdƒtˆƒ|_‰ˆjddˆtd�‰‡‡fd d „}ˆjd |ƒ‡‡‡fd d „}ˆjd |ƒdS)N)rÞ)rZrXrYréð)r?r-ržrE)rXrZrY)ri)Zwindowràcs$ˆjƒˆjƒf}ˆjd|d�dS)Nz 0 0 %s %s)Z scrollregion)Úwinfo_reqwidthZwinfo_reqheightr½)r¾r)ÚcanvasrÈrTrUÚ_configure_interiorðsz;VerticalScrolledFrame.__init__.._configure_interiorz cs&ˆjƒˆjƒkr"ˆjˆˆjƒd�dS)N)rE)rZ winfo_widthZ itemconfigure)r¾)rrÈÚ interior_idrTrUÚ_configure_canvasösz9VerticalScrolledFrame.__init__.._configure_canvas)r$rFr*rrcrrr rr�rrr r½rœZ xview_movetoZ yview_movetorÈZ create_windowrrš)rQrGr­ÚkwZ vscrollbarrrrT)rrÈrrUrFÛs       zVerticalScrolledFrame.__init__N)rÎrÏrÐrÑrFrTrTrTrUrÇÔsrÇÚ__main__)rØz#idlelib.idle_test.test_configdialogrhF)Ú verbosityÚexit)Úrun)_rÑZtkinterrrrrrrrr r r r r rrrrrrrrrrrrrrrrrrr Z tkinter.ttkr!r"r#r$r%r&r'r(r)r*r+Ztkinter.colorchooserZ colorchooserr›Z tkinter.fontrrýr,Zidlelib.configr-r.Zidlelib.config_keyr/Zidlelib.dynoptionr0Zidlelibr1Z idlelib.queryr2r3Zidlelib.textviewr4Zidlelib.autocompleter5Zidlelib.codecontextr6Zidlelib.parenmatchr7Zidlelib.paragraphr8Zidlelib.squeezerr9rrr‚r:ryr^r\r_r`r rOr}r~r•rÇrÎZunittestrØZidlelib.idle_test.htestr rTrTrTrUÚ sj„4            Q4l= +