\dNdZddlZddlmZmZmZmZmZmZm 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,m-Z-m.Z.ddlm/Z/ddl0m1Z2ddlm3Z3ddl4m5Z5m6Z6ddl7m8Z8dd l9m:Z:dd l;mZ>m?Z?dd l@mAZAdd lBmCZCddlDmEZEddlFmGZGddlHmIZIddlJmKZKddl@mLZLe6ZMeCeEeGeIeKfZNGddeZOdaPGdde"ZQGdde"ZRGdde"ZSGdde"ZTGdde"ZUGd d!e"ZVGd"d#e#ZWGd$d%ZXeXZYd&ZZd'd(d)d*d+d,Z[d-Z\Gd.d/e"Z]e^d0kr'dd1l_m`Z`e`d2d3d45dd6lambZbebeOdSdS)7aIDLE 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. N)ToplevelListboxCanvas StringVar BooleanVarIntVarTRUEFALSETOPBOTTOMRIGHTLEFTSOLIDGROOVENONEBOTHXYWEEWNSNSEWNW HORIZONTALVERTICALANCHORACTIVEENDTclError) Frame LabelFrameButton CheckbuttonEntryLabel OptionMenuNotebook Radiobutton ScrollbarStyleSpinboxCombobox) colorchooser) messagebox)idleConf ConfigChanges) GetKeysWindow) DynOptionMenu)macosx) SectionName HelpSource) view_text) AutoComplete) CodeContext) ParenMatch)FormatParagraph)Squeezer)ScrollableTextFramecbeZdZdZdddddZdZdZdZd Zd Z fd Z d Z d Z dZ xZS) ConfigDialogzConfig dialog for IDLE. F)_htest_utestctj||||_|ri|_|s|||pd|dz}||sdndz}|d|d|| | tt| || d|j|jjt$|s>|||dSdS) aShow 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. zIDLE Preferences+heightwidthWM_DELETE_WINDOWN)r__init__parent instance_dictwithdrawtitle winfo_rootx winfo_rootygeometrycreate_widgets resizabler transientprotocolcancelfontpagefontlist focus_settracersattachgrab_set wm_deiconify wait_window)selfrMrPrArBxys %..\python\lib\idlelib\configdialog.pyrLzConfigDialog.__init__1ss $'''  &#%F   MMOOO 5..///    2 %    f$=BB# > k!kkakk"""  e5111 v ($+666 ((***   MMOOO                ct|dx|_}|jdt|x|_}t ||_t||j|_t||j|_ t||j|_ t||_t||_||j d||jd||j d||jd ||jd ||jd ||t(t*t, |t0 dS)aCreate and place widgets for tabbed dialog. Widgets Bound to self: frame: encloses all other widgets note: Notebook highpage: HighPage fontpage: FontPage keyspage: KeysPage winpage: WinPage shedpage: ShedPage extpage: ExtPage Methods: create_action_buttons load_configs: Load pages except for extensions. activate_config_changes: Tell editors to reload. 5pxpaddingnwes)stickyz Fonts text Highlightsz Keys z Windows z Shell/Ed ExtensionssideexpandfillrqN)r!framegridr(noteExtPageextpageHighPagehighpageFontPagerYKeysPagekeyspageWinPagewinpageShedPageshedpageaddenable_traversalpackr r rcreate_action_buttonsr )rarurws rdrTzConfigDialog.create_widgets`s$#47777 U v&&&#E??* Dt}}  t|44  t}55  t|44 t}}    Y/// \222 X... K000 \222 L111  s4d 333 ""$$))v)66666rectjri}nddi}t|jd}t|d}i|_d|jfd|jfd|jfd|jffD]J\}}t|f||td ||j|<|j| td Kt|dd  t| t|S)aReturn 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 ri)rhOkApplyCancelHelp)rmcommand takefocus)rqpadxr)rI borderwidthrt)r4isAquaTkr!rubuttonsokapplyrXhelpr#r rrr r )ra padding_argsouter buttons_frametxtcmds rdrz"ConfigDialog.create_action_buttonss($ ?   /LL%v.Ldj!,,,eQ///  47O dj ! t{ # TY  ! 6 6HC !'}!83!&!8!8*6!8!8DL  L  " "1 " 5 5 5 5 eA1---222<<<''' recV||dS)z*Apply config changes, then dismiss dialog.N)rdestroyras rdrzConfigDialog.oks   rec|t|j|dS)z+Apply config changes and leave dialog open.N)deactivate_current_configchangessave_allrysave_all_changed_extensionsactivate_config_changesrs rdrzConfigDialog.applysR &&((( 00222 $$&&&&&rec`t|dS)zPDismiss config dialog. Methods: destroy: inherited N)rclearrrs rdrXzConfigDialog.cancels"   rec|jjdda|t dS)N1.0end)rY font_samplegetfont_sample_text grab_releasesuperr)ra __class__s rdrzConfigDialog.destroysJ=488FF  rec |j|jd}t |dt t |dzdS)zCreate textview for config dialog help. Attributes accessed: note Methods: view_text: Method from textview module. rm)optionzHelp for IDLE preferencesr@)rPcontentsN)rwtabselectstripr7 help_common help_pagesr)rapages rdrzConfigDialog.helpswy}}TY--//}??EEGG$9&z~~dB'?'?? A A A A A Arect|jj}|D]}|dS)zRemove current key bindings. Iterate over window instances defined in parent and remove the keybindings. N)rMrNkeysRemoveKeybindings)ra win_instancesinstances rdrz&ConfigDialog.deactivate_current_configsH 16688 % ) )H  & & ( ( ( ( ) )recx|jj}|D]z}||||||{tD]}| dS)zApply configuration changes to current windows. Dynamically update the current parent window instances with some of the configuration changes. N) rMrNrResetColorizer ResetFontset_notabs_indentwidthApplyKeybindingsreset_help_menu_entriesupdate_cursor_blink reloadablesreload)rarrklasss rdrz$ConfigDialog.activate_config_changess  16688 % + +H  # # % % %     + + - - -  % % ' ' '  , , . . .  ( ( * * * *   E LLNNNN  re)r@)__name__ __module__ __qualname____doc__rLrTrrrrXrrrr __classcell__rs@rdr?r?-s-5-----^$7$7$7L&&&P ''' A A A ) ) )rer?u^ AaBbCcDdEeFfGgHhIiJj 1234567890#:+=(){}[] ¢£¥§©«®¶½ĞÀÁÂÃÄÅÇÐØß ɐɕɘɞɟɤɫɮɰɷɻʁʃʆʎʞʢʫʭʯ ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκ БбДдЖжПпФфЧчЪъЭэѠѤѬӜ אבגדהוזחטיךכלםמןנסעף ابجدهوزحطي٠١٢٣٤٥٦٧٨٩ ०१२३४५६७८९अआइईउऊएऐओऔ ௦௧௨௩௪௫௬௭௮௯அஇஉஎ 〇一二三四五六七八九 汉字漢字人木火土金水 가냐더려모뵤수유즈치 あいうえおアイウエオ c>eZdZfdZdZdZdZdZddZxZ S) r|ct||j|_||dSN)rrLhighlight_samplecreate_page_font load_font_cfg)ramasterr{rs rdrLzFontPage.__init__"sP    ( 9  rec6tt||j|_tt||j|_tt ||j|_t|dtd}t|dtd}t|}t|}t|td}t|ddt |_|jd |j|jd |j|jd |jt%|}||jj |j|jt|d}t-||jd|_t1||jddd|_t5|}|j|_|jt:dd|jt>t@|!dd|"dd|#dddd|#dddddd|$tJddtL|$tJddtL|$tJtN|j$ttPtL|$ttR |$ttN|j$ttN|j$ttNd!"|$tPtT#dS)$aRReturn frame of widgets for Font 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. 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 rz Shell/Editor Font rreliefrmz Font Sample (Editable) z Font Face :)justifyrmTrIrexportselectionzzr)yscrollcommandzSize :rlNrBold)variableonvalueoffvaluerm)wraprJrIweightr)rowcolumnrpadyrnsew)rrrowspanrrrkrqrrrsrqanchorrp)rqrsrDrqrr)rrrs)+r\rrvar_changed_font font_name font_sizer font_boldr"rr!r&rrr rZbindon_fontlist_selectr*configyviewsetr3sizelistr$ bold_toggler=rmrrinsertrrcolumnconfigure rowconfigurervrr rrr rr) ra frame_font frame_sampleframe_font_nameframe_font_paramfont_name_title scroll_fontfont_size_titlefont_sample_frames rdrzFontPage.create_page_font(sL!Yt__d6KLL Yt__d6KLL Z%5%5t7LMM !F%:<<< !$Af'ACCC  ++ ,,MCCC*.GGG  .0GHHH ,d.EFFF .0GHHH00 4=#6777 KO<<< 0x@@@%&6MM & 4>AF4440 ==,1 T1=== %5666 Qq))) !A&&&Aaaa888a111!'  ) ) ) #AAA>>>3QQQ???#a000 T:::d+++$q111 Q/// 4;;;d66666rec0tj|dd}|d}|d}|ddk}tt t j|}|D]"}|jt|#|j |d|D} | |}|j ||j ||j||j|n#t $rYnwxYw|jd||j||d S) 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. main EditorWindowrrrboldc6g|]}|S)lower).0ss rd z*FontPage.load_font_cfg..s ---!AGGII---re)78910111213141618202225293440N)r0GetFontrsortedrtkfontfamiliesrZrrrindexsee select_set select_anchoractivate ValueErrorrSetMenur set_samples) raconfigured_fontrrrfontsfontlc_fontscurrent_font_indexs rdrzFontPage.load_font_cfgs#*4HH#A&,,.. #A& $Q'/ s6?4001122 , ,D M d + + + + 9%%%--u--- !) !:!:  M  0 1 1 1 M $ $%7 8 8 8 M ' '(: ; ; ; M " "#5 6 6 6 6    D  O' ) ) ) 9%%% s?A=D== E  E cr|j}tddd||j}tddd||j}tddd||dS)zStore 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 r0z font-sizez font-boldN)rrr add_optionrrr-raparamsvalues rdrzFontPage.var_changed_fonts""$$6>65AAA""$$6>;FFF""$$6>;FFF rec|j|jjdkrtnt }|j|dS)zHandle 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. KeyReleaseN) rZrtypenamerrrrr)raeventr0s rdrzFontPage.on_fontlist_selectsV }  */\99vGG 4::<<(((((reNc|j}|jr tjn tj}||j|f}||jd<||jd<dS)zUpdate 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. r0N) rrrr$BOLDNORMALrrr)rar<r font_weightnew_fonts rdr-zFontPage.set_samplessqN&&(( %)^%7%7%9%9Lfkkv} t~1133[A#+ (0f%%%rer) rrrrLrrrrr-rrs@rdr|r| s W7W7W7r   D   ))) 1 1 1 1 1 1 1 1rer|ceZdZfdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZxZS)rzct|||_||_t ||_||dSr) rrLrywinfo_toplevelcdr+stylecreate_page_highlightload_theme_cfgrarryrs rdrLzHighPage.__init__sl     ''))6]]  ""$$$ rec iddddddddd d d d d ddddddddddddddddddd _ttj_ttj_t_ ttj _ ttj _ ttj_t!d!t"d"#}t!d!t"d$#}t%|t&d%&}|jx}_|d'd(d%d%t.d)t0*|d+d,|d-d.d/}|D]!\}}|t6||"t9|d0t6}t?d%|D]=} || d1| t9tA|d2d3d4>jD]1} | ffd5 } |!j| d)d6| 2d7|d8<j"d9d%d:;tG|d9<_$tG|} tKj$d=j&>_'tQj$jd?d)@_)tU| j d%dAj+B_,tU| j d)dCj+B_-j .d%tK|dDj/>_0tc|dEF} tU|j d%j2dGH_3tU|j d)j2dIH_4tQ|jd?d?J_5tQ|jd?d?J_6tK|dKj7>_8tc|d!L_9|:tvdMdMtxtzN|:t|dMdMt~Oj$:t|dMdMt~O| :t|dMd)P|:t|dMdMtxtzNj':t|txt~dQdRSj):t|txt~dQdTSj,:tvtUj-:ttUj0:tt~dMdMV| :t|tdMdMWj3:t|tdMXj4:t|tdMd!Wj5:t|t~dMdMVj6:t|t~tdMdMYj8:t|t~dMdMVj9:t|t~dMZd?S)[aReturn frame of widgets for Highlights tab. Enable users to provisionally change foreground and background colors applied to textual tags. Color mappings are stored in complete listings called themes. Built-in themes in idlelib/config-highlight.def are fixed as far as the dialog is concerned. Any theme can be used as the base for a new custom theme, stored in .idlerc/config-highlight.cfg. Function load_theme_cfg() initializes tk variables and theme lists and calls paint_theme_sample() and set_highlight_target() for the current theme. Radiobuttons builtin_theme_on and custom_theme_on toggle var theme_source, which controls if the current set of colors are from a builtin or custom theme. DynOptionMenus builtinlist and customlist contain lists of the builtin and custom themes, respectively, and the current item from each list is stored in vars builtin_name and custom_name. Function paint_theme_sample() applies the colors from the theme to the tags in text widget highlight_sample and then invokes set_color_sample(). Function set_highlight_target() sets the state of the radiobuttons fg_on and bg_on based on the tag and it also invokes set_color_sample(). Function set_color_sample() sets the background color for the frame holding the color selector. This provides a larger visual of the color for the current tag and plane (foreground/background). Note: set_color_sample() is called from many places and is often called more than once when a change is made. It is invoked when foreground or background is selected (radiobuttons), from paint_theme_sample() (theme is changed or load_cfg is called), and from set_highlight_target() (target tag is changed or load_cfg called). Button delete_custom invokes delete_custom() to delete a custom theme from idleConf.userCfg['highlight'] and changes. Button save_custom invokes save_as_new_theme() which calls get_new_theme_name() and create_new() to save a custom theme and its colors to idleConf.userCfg['highlight']. Radiobuttons fg_on and bg_on toggle var fg_bg_toggle to control if the current selected color for a tag is for the foreground or background. DynOptionMenu targetlist contains a readable description of the tags applied to Python source within IDLE. Selecting one of the tags from this list populates highlight_target, which has a callback function set_highlight_target(). Text widget highlight_sample displays a block of text (which is mock Python code) in which is embedded the defined tags and reflects the color attributes of the current theme and changes for those tags. Mouse button 1 allows for selection of a tag and updates highlight_target with that tag value. Note: The font in highlight_sample is set through the config in the fonts tab. In other words, a tag can be selected either from targetlist or by clicking on the sample text within highlight_sample. The plane (foreground/background) is selected via the radiobutton. Together, these two (tag and plane) control what color is shown in set_color_sample() for the current theme. Button set_color invokes get_color() which displays a ColorChooser to change the color for the selected tag/plane. If a new color is picked, it will be saved to changes and the highlight_sample and frame background will be updated. Tk Variables: color: Color of selected target. builtin_name: Menu variable for built-in theme. custom_name: Menu variable for custom theme. fg_bg_toggle: Toggle for foreground/background color. Note: this has no callback. theme_source: Selector for built-in or custom theme. highlight_target: Menu variable for the highlight tag target. Instance Data Attributes: theme_elements: Dictionary of tags for text highlighting. The key is the display name and the value is a tuple of (tag name, display sort order). Methods [attachment]: load_theme_cfg: Load current highlight colors. get_color: Invoke colorchooser [button_set_color]. set_color_sample_binding: Call set_color_sample [fg_bg_toggle]. set_highlight_target: set fg_bg_toggle, set_color_sample(). set_color_sample: Set frame background to target. on_new_color_set: Set new color and add option. paint_theme_sample: Recolor sample. get_new_theme_name: Get from popup. create_new: Combine theme with changes and save. save_as_new_theme: Save [button_save_custom]. set_theme_type: Command for [theme_source]. delete_custom: Activate default [button_delete_custom]. save_new: Save to userCfg['theme'] (is function). Widgets of highlights page frame: (*) widgets bound to self frame_custom: LabelFrame (*)highlight_sample: Text (*)frame_color_set: Frame (*)button_set_color: Button (*)targetlist: DynOptionMenu - highlight_target frame_fg_bg_toggle: Frame (*)fg_on: Radiobutton - fg_bg_toggle (*)bg_on: Radiobutton - fg_bg_toggle (*)button_save_custom: Button frame_theme: LabelFrame theme_type_title: Label (*)builtin_theme_on: Radiobutton - theme_source (*)custom_theme_on: Radiobutton - theme_source (*)builtinlist: DynOptionMenu - builtin_name (*)customlist: DynOptionMenu - custom_name (*)button_delete_custom: Button (*)theme_message: Label zNormal Code or Text)normal00z Code Context)context01zPython Keywords)keyword02zPython Definitions) definition03zPython Builtins)builtin04zPython Comments)comment05zPython Strings)string06z Selected Text)hilite07z Found Text)hit08Cursor)cursor09zEditor Breakpoint)breakrz Shell Prompt)consolerz Error Text)errorrzShell User Output)stdoutrzShell User Exception)stderrrz Line Number) linenumberrrz Custom Highlighting rz Highlighting Theme r)rr)courier r@hand2r)r0r^rJrIrhighlightthicknessrzcdSNr`r es rdz0HighPage.create_page_highlight..usrez cdSrkr rls rdrnz0HighPage.create_page_highlight..vs7re)")z# Click selects item.rU rK)zcode context sectionrMrp)z| cursorr^rp)defrO) rK)funcrQ)z (param): rK)z"Return None."rW)z var0 = rK)z'string'rW)z var1 = rK)z 'selected'rY)z var2 = rK)z'found'r[)z var3 = rK)listrS)(rK)NonerO)z) rK)z breakpoint("line")r`)z rKz>>>ra)z 3.14**2 rK)z9.8596rcrprx)z pri rK)nrb)zt( rK) SyntaxErrorrdrprz.0drsrec<j|dSr)highlight_targetr)r<elemras rdtemz+HighPage.create_page_highlight..tems %))$/////rezdisabledstateframe_color_set.TFramesolid)rr)rFzChoose Color for :rmrN)ri Foreground)rr7rmr BackgroundzSave as New Custom Themez Select : rlza Built-in Themerr7rrmza Custom ThemerzDelete Custom Themerrrqrrrrrsrrqrr)rqrrrsrrrrrqrsrrrqrrrr)rqrsrrr)rqrsr)Dtheme_elementsr\rrvar_changed_builtin_name builtin_namevar_changed_custom_name custom_namer fg_bg_togglevar_changed_colorcolorvar_changed_theme_source theme_sourcevar_changed_highlight_targetr}r"rr=rrmr configurer rrrrlenr splitlinesrangestrtag_bindrFr!frame_color_setr# get_colorbutton_set_colorr3 targetlistr)set_color_sample_bindingfg_onbg_onrsave_as_new_themebutton_save_customr&set_theme_typebuiltin_theme_oncustom_theme_on builtinlist customlist delete_custombutton_delete_custom theme_messagerrr rr rrr rr )ra frame_custom frame_theme sample_framerm string_tagsrWtagn_lineslinenoelementrframe_fg_bg_toggletheme_type_titles` rdrGzHighPage.create_page_highlightsj !#3 - 0 !"6  0  0  . - - &  - / !1 #$4 /!$$KK$!>@@";;$!=??&t,,[[$!799 #KK4  $"?AA ' $!B!D!D "$Af'>@@@  1V&<>>> +U;;; '3'88t$ (!AD  B B B %'8'8999 -!2!23339 $' * *KFC KKVS ) ) ) )dhhuc**557788Aw'' & &F KK6 !3s7||#4#4999999$ & & & &* M MG ' 0 0 0 0 0 0 MM'035F M M M M"W  51$+  - - -$\9QRRR"<00 &$+?!(!(!(($d&;T#$&&&!"T->a!4+HJJJ !"T->a!4+HJJJ  a   "(#=.#0#0#0!;??? +d&7q+2D!F!F!F +d&7q+2B D D D)T.dDDD'T-tTCCC$*"7*%,%,%,!#;A>>> t!!DtLLLc::: !!s!CCCSqq999qqD  B B B ""Dqqq"QQQ #dKKK T!,,, U1--- $$&qqq$III3qqqAAA ""AA">>> !!s111!EEE 3QQQ??? #AaaaHHH !&&Caaa&HHH Sqq99999rec jtjdddddtj}jrtjdd}|j ||tjdd}||s5j d j d nj ||d ntjdd}|j ||tjdd}|j ||d tj}|fd  j ||d dS)aLoad 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 Themedefaultboolrr:r highlightuserr- no custom themes -rc*j|dS)Nr)r)rbras rdrnz)HighPage.load_theme_cfg..st':1'=a'@re)keyN)rrr0 GetOption CurrentThemerGetSectionListsortrr,rrrrrrurrrpaint_theme_sampleset_highlight_target)racurrent_option item_list theme_namess` rdrHzHighPage.load_theme_cfgs1* h0DDD E E E".00   " " > / ;GGI NN      $ $Y ? ? ? / DDI NN    A$**=999 $$%;<<<<'' 9Q<@@@@ / DDI NN    O # #I~ > > > / ;GGI NN      $ $Y ! = = = 4.335566 @@@@AAA  [^<<< !!! !!#####recd}|j}||vrctjddd|vr#tddd|dtddd|d|jd<nDtddd|tdddd d |jd<|d S) zProcess new builtin theme selection. Add the changed theme's name to the changed_items and recreate the sample with the values from the selected theme. )z IDLE ClassiczIDLE Newr rr;rname2zNew theme, see Helprmr@N)rrr0rrr4rr)rar6 old_themesr7s rdrz!HighPage.var_changed_builtin_names 2 !%%''  " "!&'6::*LL""67FJqMJJJ   vw ? ? ?)>D v & &   vw > > >   vw < < <)+D v & !!!!!rec|j}|dkr3tddd||dSdS)zProcess new custom theme selection. If a new custom theme is selected, add the name to the changed_items and apply the theme to the sample. rr rr;N)rrrr4rr5s rdrz HighPage.var_changed_custom_names^  $$&& * * *   vw > > >  # # % % % % % + *rec|j}tddd||r|dS|dS)zProcess toggle between builtin and custom theme. Update the default toggle value and apply the newly selected theme type. r rrN)rrrr4rrr5s rdrz!HighPage.var_changed_theme_source$sj !%%''67Iu===  +  ) ) + + + + +  ( ( * * * * *rec.|dS)zProcess change to color choice.N)on_new_color_setrar6s rdrzHighPage.var_changed_color1s rec.|dS)z5Process selection of new target tag for highlighting.N)rrs rdrz%HighPage.var_changed_highlight_target5 !!#####rec(|jr0d|jd<d|jd<|jddSd|jd<|jdd|jd<|jddS)aSet available screen options based on builtin or custom theme. Attributes accessed: theme_source Attributes updated: builtinlist customlist button_delete_custom custom_theme_on Called from: handler for builtin_theme_on and custom_theme_on delete_custom create_new load_theme_cfg rKrrrz !disabledN)rrrrrrrrs rdrzHighPage.set_theme_type9s$   " " <(0D W %'1DOG $  % + +M : : : : :(2D W %  & &~ 6 6 6'/DOG $  % + +N ; ; ; ; ;rec|j}|j|jdd}t j|d|z|\}}|r||kr|jrLd}||}|sdS| ||j |dS|j |dSdSdS)aHandle button to select a new color for the target tag. If a new color is selected while using a builtin theme, a name must be supplied to create a custom theme. Attributes accessed: highlight_target frame_color_set theme_source Attributes updated: color Methods: get_new_theme_name create_new rF backgroundzPick new color for : )rMrP initialcolorz_Your changes will be saved as a new Custom Theme. Enter a name for your new Custom Theme below.N) r}rrFlookuprr.askcolorrget_new_theme_name create_newrr)ratarget prev_color rgbTuplet color_stringmessage new_themes rdrzHighPage.get_colorUs$&**,,Z&&t';G'D'355 "."7#:6#A'#)#)#) <  -\Z77 $$&& -K 33G<<  1FOOI...JNN<00000 |,,,,, - -77rec|j}|jd||jrdnd}|j|jd}|jj|fi||i|j }|dz|z}t d|||dS) z4Display sample of new color selection on the dialog.rr foregroundrr-rN) rrrFrrrr}r tag_configrrr4)ra new_colorplanesample_elementtheme theme_elements rdrzHighPage.on_new_color_set{sJNN$$  5)LLL $ 1 5 5 7 7I \,T-B-F-F-H-HI!L((NNE9;MNNN $$&&&,u4 ;}iHHHHHrectjddtjddz}t|d||j}|S)z*Return name of new theme from query popup.rrrzNew Custom Themer0rr5result)rar used_namesrs rdrzHighPage.get_new_theme_namesO-fkBB' ;??@ (':???E recb|d}|r||dSdS)zPrompt for new theme name and create the theme. Methods: get_new_theme_name create_new zNew Theme Name:N)rr)ranew_theme_names rdrzHighPage.save_as_new_themesB001BCC  , OON + + + + + , ,recD|jrd}|j}nd}|j}t j||}|t dvr#t d|}|D] }||||<|||t jdd}| |j |||j d| dS)aCreate a new custom theme with the given name. Create the new theme based on the previously active theme with the current changes applied. Once it is saved, then activate the new theme. Attributes accessed: builtin_name custom_name Attributes updated: customlist theme_source Method: save_new set_theme_type rrrrN)rrrrr0 GetThemeDictrsave_newrrrr,rr)rar theme_type theme_namer theme_changesrcustom_theme_lists rdrzHighPage.create_news"&   " " 0"J*..00JJJ)--//J)*jAA - - -#K0BBB a    rec|jdkrO|jd|jd|jdnN|jd|jd|jd|dS)ahSet fg/bg toggle and color based on highlight tag target. Instance variables accessed: highlight_target Attributes updated: fg_on bg_on fg_bg_toggle Methods: set_color_sample Called from: var_changed_highlight_target load_theme_cfg r]rrrN)r}rrrrrrset_color_samplers rdrzHighPage.set_highlight_targets$  $ $ & &( 2 2 J  ] + + + J  ] + + +   ! !! $ $ $ $ J  ^ , , , J  ^ , , ,   ! !! $ $ $ rec.|dS)zrChange color sample based on foreground/background toggle. Methods: set_color_sample N)r)raargss rdrz!HighPage.set_color_sample_bindings rec|j|jd}|jrdnd}|j||}|jd|dS)aSet the color of the frame background to reflect the selected target. Instance variables accessed: theme_elements highlight_target fg_bg_toggle highlight_sample Attributes updated: frame_color_set rrrrrN)rr}rrrtag_cgetrFr)rarrrs rdrzHighPage.set_color_samples|!$"7";";"="=>qA $ 1 5 5 7 7I \%..sE:: 5%HHHHHrec0|jr|j}n|j}|jD]}|j|d}t j||}|dkrt j|dd|d<|tdvr=td|}|dz|vr||dz|d<|dz|vr||dz|d<|jj |fi|| d S) aApply the theme colors to each element tag in the sample text. Instance attributes accessed: theme_elements theme_source builtin_name custom_name Attributes updated: highlight_sample: Set the tag elements to the theme. Methods: set_color_sample Called from: var_changed_builtin_name var_changed_custom_name load_theme_cfg rr^rKrrz -foregroundrz -backgroundN) rrrrrr0 GetHighlightrrrr)rar element_titlercolors theme_dicts rdrzHighPage.paint_theme_samplesN(   " " +%))++EE$((**E!0 @ @M)-8;G*5'::F(""'/'<x()())5(7|$ ,,,$[1%8 ]*j88+5g 6M+NF<(]*j88+5g 6M+NF<( ,D ! ,W ? ? ? ? ? ? rectjd||D]1}||}tjd|||2dS)zSave a newly created theme to idleConf. theme_name - string, the name of the new theme theme - dictionary containing the new theme rNr0userCfg AddSection SetOption)rarrrr7s rdrzHighPage.save_newsi %00<<< P PG'NE  [ ) 3 3J O O O O P Prec$tj|i|Srr/askyesnorarkwargss rdrzHighPage.askyesno*"D3F333rec|j}d}|d||z|sdS|jt d|tjdd}| |s6|j d|j |dn!|j ||d |jtjd d d |jtjd d d t |j|j|dS)a!Handle event to delete custom theme. The current theme is deactivated and the default theme is activated. The custom theme is permanently removed from the config file. Attributes accessed: custom_name Attributes updated: custom_theme_on customlist theme_source builtin_name Methods: deactivate_current_config save_all_changed_extensions activate_config_changes set_theme_type z.Are you sure you wish to delete the theme %r ?z Delete ThemerMNrrrrrr rrr;)rrrrErrdelete_sectionr0rrrrrr,rr defaultCfgGetrrryrrr)rardelmsgrs rdrzHighPage.delete_custom.s,%))++ A}}*!4TCC  F ))+++{J777+FK@@  =  & &} 5 5 5 O # #I/E F F F F O # #Iy| < < < h1&9==gyQQRRR h1&9==gvNNOOO 00222 ''))) re)rrrrLrGrHrrrrrrrrrrrrrrrrrrrrs@rdrzrzsu|:|:|:|2$2$2$h"""& & & & + + +   $$$<<<8$-$-$-L I I I , , ,&&&P   8   III$& & & P P P P444-------rerzceZdZfdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZedZdZdZxZS)r}ct|||_||_||dSr)rrLryrDrEcreate_page_keys load_key_cfgrIs rdrLzKeysPage.__init__`s_     ''))  rec tt||j|_tt||j|_tt||j|_ tt||j |_ t|dtd}t|dtdt|}t|d}t!|}t!|t"}t%|t&t&|_|jd |j|jj|d <|jj|d <|j|jd <|j|jd <t5|d |jd|_fdt;dD}t=|d|j d|jd|_ t=|d|j d|jd|_!tE|d|jdd|_#tE|d|jdd|_$t5|dd|j%|_&t5|dd|j'|_(t|dd|_)|*tVddtXtZ*tVddtZ|j*tVt\dd|*t^ddtXtZ|0dd |1dd |2dddtf!|j2ddth"|2ddtj"|2ddtl"|j 2ddtftjz"|j!2ddtftjz"|j#2ddth"|j$2ddth"|j)2ddthdd#|j&*t^t\d$d%|j(*t^t\d$d%|d*tntZd$&|d*tnt\d$d'dS)(aReturn frame of widgets for Keys tab. Enable users to provisionally change both individual and sets of keybindings (shortcut keys). Except for features implemented as extensions, keybindings are stored in complete sets called keysets. Built-in keysets in idlelib/config-keys.def are fixed as far as the dialog is concerned. Any keyset can be used as the base for a new custom keyset, stored in .idlerc/config-keys.cfg. Function load_key_cfg() initializes tk variables and keyset lists and calls load_keys_list for the current keyset. Radiobuttons builtin_keyset_on and custom_keyset_on toggle var keyset_source, which controls if the current set of keybindings are from a builtin or custom keyset. DynOptionMenus builtinlist and customlist contain lists of the builtin and custom keysets, respectively, and the current item from each list is stored in vars builtin_name and custom_name. Button delete_custom_keys invokes delete_custom_keys() to delete a custom keyset from idleConf.userCfg['keys'] and changes. Button save_custom_keys invokes save_as_new_key_set() which calls get_new_keys_name() and create_new_key_set() to save a custom keyset and its keybindings to idleConf.userCfg['keys']. Listbox bindingslist contains all of the keybindings for the selected keyset. The keybindings are loaded in load_keys_list() and are pairs of (event, [keys]) where keys can be a list of one or more key combinations to bind to the same event. Mouse button 1 click invokes on_bindingslist_select(), which allows button_new_keys to be clicked. So, an item is selected in listbindings, which activates button_new_keys, and clicking button_new_keys calls function get_new_keys(). Function get_new_keys() gets the key mappings from the current keyset for the binding event item that was selected. The function then displays another dialog, GetKeysDialog, with the selected binding event and current keys and allows new key sequences to be entered for that binding event. If the keys aren't changed, nothing happens. If the keys are changed and the keyset is a builtin, function get_new_keys_name() will be called for input of a custom keyset name. If no name is given, then the change to the keybinding will abort and no updates will be made. If a custom name is entered in the prompt or if the current keyset was already custom (and thus didn't require a prompt), then idleConf.userCfg['keys'] is updated in function create_new_key_set() with the change to the event binding. The item listing in bindingslist is updated with the new keys. Var keybinding is also set which invokes the callback function, var_changed_keybinding, to add the change to the 'keys' or 'extensions' changes tracker based on the binding type. Tk Variables: keybinding: Action/key bindings. Methods: load_keys_list: Reload active set. create_new_key_set: Combine active keyset and changes. set_keys_type: Command for keyset_source. save_new_key_set: Save to idleConf.userCfg['keys'] (is function). deactivate_current_config: Remove keys bindings in editors. Widgets for KeysPage(frame): (*) widgets bound to self frame_key_sets: LabelFrame frames[0]: Frame (*)builtin_keyset_on: Radiobutton - var keyset_source (*)custom_keyset_on: Radiobutton - var keyset_source (*)builtinlist: DynOptionMenu - var builtin_name, func keybinding_selected (*)customlist: DynOptionMenu - var custom_name, func keybinding_selected (*)keys_message: Label frames[1]: Frame (*)button_delete_custom_keys: Button - delete_custom_keys (*)button_save_custom_keys: Button - save_as_new_key_set frame_custom: LabelFrame frame_target: Frame target_title: Label scroll_target_y: Scrollbar scroll_target_x: Scrollbar (*)bindingslist: ListBox - on_bindingslist_select (*)button_new_keys: Button - get_new_keys & ..._name rz Custom Key Bindings rz Key Set zAction - Key(s)rlorient)rrrrrxscrollcommandzGet New Keys for Selectionr)rmrrc4g|]}tddS)rr)rir)r!)riframe_key_setss rdrz-KeysPage.create_page_keys..s8%%%qAAA%%%rerrzUse a Built-in Key SetrzUse a Custom Key SetNrzDelete Custom Key SetrzSave as New Custom Key Setrrrrrr)rr columnspanrkrrrk)rrrkrrT)rqrsrrrrqrsrr)rqrsrrr)8r\rrrrrrrvar_changed_keyset_source keyset_sourcevar_changed_keybinding keybindingr"rr!r&r*rrr bindingslistron_bindingslist_selectrxviewrr# get_new_keysbutton_new_keysrr) set_keys_typebuiltin_keyset_oncustom_keyset_onr3rrdelete_custom_keysbutton_delete_custom_keyssave_as_new_key_setbutton_save_custom_keys keys_messagerr r rrrrrrvrrrrr )rar frame_target target_titlescroll_target_yscroll_target_xframesr%s @rdrzKeysPage.create_page_keysgs^d$KK$!>@@";;$!=??$[[4  $"@BB!++$!<>> "!F,... $!FFFF\** \0ABBB #L11#LDDD#uFFF 2#: < < <%)%6%< "%)%6%< ".=.A*+.=.A*+%#?) = = =%%%% 88%%%!,q D$6a*1I"K"K"K!,q D$6a*1G!I!I!I)q 4,dDBBB'q 4+T4AAA)/q 7/*1*1*1&(.q <0(2(2(2$"&);;; vAAdNNNaadCCC !!vAAA!FFFt!!DtLLL$$Qq$111!!!A!...aaBBB 1Qt<<<1R8881R888 ##!AbD#AAA ""q1R4"@@@ !Ad;;; 1T::: 1Qt!!LLL &++AdQR+SSS $))t!Dq)QQQq Cd4888q Ca1=====rec |jtjdddddtj}|jrtjdd}||j ||tjdd}||s5|j d |j d n|j ||d ntjdd}||j ||tjdd}||j |tj|tj}||d S) z?Load current configuration settings for the keybinding options.r Keysrrrrrrr- no custom keys -rN)r*rr0r CurrentKeysrrrrr,r4rrr default_keysr2load_keys_list)rarr keyset_names rdrzKeysPage.load_key_cfgs x1  C C C D D D"-//   ! ! # # I / 6BBI NN      $ $Y ? ? ? /??I NN    A%++M::: $$%9::::'' 9Q<@@@@ /??I NN    O # #I~ > > > / 6BBI NN      $ $Y0E0G0G H H H *,,  K(((((recd}|j}||vrctjddd|vr#tddd|dtddd|d|jd<nDtddd|tdddd d |jd<||d S) z%Process selection of builtin key set.)zIDLE Classic WindowszIDLE Classic UnixzIDLE Classic MaczIDLE Classic OSXr r@r;rrzNew key set, see Helprmr@N)rrr0rrr4r9rD)rar6old_keysr7s rdrz!KeysPage.var_changed_builtin_name&s  !%%''  !&&&99II""6668A;GGG   vvw > > >(?D f % %   vvvu = = =   vvw ; ; ;(*D f % E"""""rec|j}|dkr4tddd|||dSdS)z$Process selection of custom key set.rAr r@r;N)rrrr4rDr5s rdrz KeysPage.var_changed_custom_name:s^ $$&& ( ( (   vvvu = = =    & & & & & ) (rec|j}tddd||r|dS|dS)z:Process toggle between builtin key set and custom key set.r r@rN)r*rrr4rrr5s rdr)z"KeysPage.var_changed_keyset_sourceAsh"&&((669e<<<  +  ) ) + + + + +  ( ( * * * * *rec|j}|j}|jtd}t j|rt d|||dSt j |}|dz}t d|||dS)zStore change to a keybinding.rr _cfgBindings extensionsN) r,rrr-rsplitr0 IsCoreBindingrr4GetExtnNameForEvent)rar6r7key_setr<ext_nameext_keybind_sections rdr+zKeysPage.var_changed_keybindingJs##%%"&&((!%%f--3355a8  !% ( ( P   vwu = = = = =3E::H"*^";    |-@% O O O O Orec(|jr0d|jd<d|jd<|jddSd|jd<|jdd|jd<|jddS)z@Set available screen options based on builtin or custom key set.rKrrrrN)r*rrrr6rr4rs rdr2zKeysPage.set_keys_typeVs   ! ! # # A(0D W %'1DOG $  * 0 0 ? ? ? ? ?(2D W %  ! ' ' 7 7 7'/DOG $  * 0 0 @ @ @ @ @rec|jt}|j|}|d}|jr|j}n|j}tj }|tdvr5td|}|D]}||||< t| }t|d||j} | r|jrdd} || } | s6|j||j|dS|| |j||j||dz| z|j||j||j| dS|j||j|dS)a^Handle event to change key binding for selected line. A selection of a key/binding in the list of current bindings pops up a dialog to enter a new binding. If the current key set is builtin and a binding has changed, then a name for a custom key set needs to be entered for the change to be applied. rrz Get New KeyszcYour changes will be saved as a new Custom Key Set. Enter a name for your new Custom Key Set below.N - )r-r&rrrMr*rrr0GetCurrentKeySetrruvaluesr2rget_new_keys_namer(r)create_new_key_setdeleterr,r) ra list_indexbinding bind_namecurrent_key_set_namecurrent_bindingskey_set_changesr<current_key_sequencesnew_keysr new_keysets rdr0zKeysPage.get_new_keysbs\&,,V44 #'' 33MMOOA&   ! ! # # :#'#4#8#8#:#: #'#3#7#7#9#9 #466 76? 2 2%fo.BCO( I I*9%*@*F*F*H*H '' $%5%<%<%>%> ? ? ~y%'''-   8!%%'' 8N!33G<< !8%00<<<%33J???F++J777   $ $Z 0 0 0   $ $Z51I J J J   ( ( 4 4 4   + +J 7 7 7 O   ) ) ) ) )   ( ( 4 4 4   + +J 7 7 7 7 7rectjddtjddz}t|d||j}|S)z)Return new key set name from query popup.rrrzNew Custom Key Setr)rarrrcs rdrXzKeysPage.get_new_keys_namesP-ff==' 6::;  *GZAAAG recb|d}|r||dSdS)z@Prompt for name of new key set and save changes using that name.zNew Key Set Name:N)rXrY)ra new_keys_names rdr7zKeysPage.save_as_new_key_setsB../BCC  3  # #M 2 2 2 2 2 3 3rec:|jddS)z6Activate button to assign new keys to selected action.rN)r1rrar<s rdr.zKeysPage.on_bindingslist_selects "">22222rec|jr|j}n|j}t j|}i}|D],}|dd}d||}|||<-|tdvr#td|}|D] }||||<|||t j dd} | |j | ||j d|dS)zCreate a new custom key set with the given name. Copy the bindings/keys from the previously active keyset to the new keyset and activate the new custom keyset. rrsrrrN)r*rrrr0 GetCoreKeysjoinrsave_new_key_setrrrr,rr2) ranew_key_set_nameprev_key_set_name prev_keysrbr< event_namer\r`custom_key_lists rdrYzKeysPage.create_new_key_sets]   ! ! # # 7 $ 1 5 5 7 7   $ 0 4 4 6 6 ():;;  + +EqtJhhy/00G#*HZ  / /%fo.?@O( 9 9"1%"8 .999"1&&AA 1ABBB q!!! recd}|jr!d}|jt}t j|}t |}||j dt|D]}d ||}|dd}|tdvr.|td|vrtd||}|j t|dz|z|rP|j||j||j|d Sd S) zReload the list of action/key binding pairs for the active key set. An action/key binding can be selected to change the key binding. FTrrsrrjrrUN)r- curselectionr&rr0 GetKeySetrurrrZrrlrrr'r(r))rarEreselectr[keyset bind_namesr]rs rdrDzKeysPage.load_keys_listss    ) ) + + 9H*0088J#K00&++--((    C(((# ? ?I((6),--C!!B$Igfo-- <<<!&/+6yAC   $ $S)E/#*= > > > >  8   ! !* - - -   ( ( 4 4 4   + +J 7 7 7 7 7 8 8rectjd||D]1}||}tjd|||2dS)aQSave a newly created core key set. Add keyset to idleConf.userCfg['keys'], not to disk. If the keyset doesn't exist, it is created. The binding/keys are taken from the keyset argument. keyset_name - string, the name of the new key set keyset - dictionary containing the new keybindings rNr )rErwr<r7s rdrmzKeysPage.save_new_key_setsi  ++K888 J JE5ME  V $ . .{E5 I I I I J Jrec$tj|i|Srrrs rdrzKeysPage.askyesnorrec|j}d}|d||z|sdS|jt d|tjdd}| |s6|j d|j |dn!|j ||d |jtjd d d |jtjd d d ptjt |j|j|dS)zHandle event to delete a custom key set. Applying the delete deactivates the current configuration and reverts to the default. The custom key set is permanently deleted from the config file. z0Are you sure you wish to delete the key set %r ?zDelete Key SetrNrrrrArr r@rr;)rrrrErrrr0rrr4rrr,r*rrrrrCrryrrr2)rarErrs rdr5zKeysPage.delete_custom_keyss&**,, C}} 6K#7FF  F ))+++v{333+FF;;  =  ! ' ' 6 6 6 O # #I/C D D D D O # #Iy| < < < x26: #FI 6 6 8 8 8 h1&9==ffMM9!)!6!8!8 : : :  00222 ''))) re)rrrrLrrrrr)r+r2r0rXr7r.rYrD staticmethodrmrr5rrs@rdr}r}^sB^>^>^>@)))>###('''+++ P P P A A A*8*8*8X333 333<8884 J J\ J444       rer}c0eZdZfdZdZdZdZxZS)rct||||dSr)rrLinit_validatorscreate_page_windowsload_windows_cfgrarrs rdrLzWinPage.__init__sW        """ recrtjdfd}||df|_dS)N[0-9]*c2|duSz+Return 's is blank or contains only digits'N fullmatchrdigits_or_empty_res rdis_digits_or_emptyz3WinPage.init_validators..is_digits_or_empty%//22$> >re%Precompileregister digits_onlyrarrs @rdrzWinPage.init_validatorsNZ 22 ? ? ? ? ?!MM*<==tErec Ntt|d|_tt |d|_tt |d|_tt |d|_tt|d|_ tt |d|_ tt |d|_ tt |d|_ tt|d |_ tt |d |_t|d t d }t#|d}t%|d}t'||jdd|_t'||jdd|_t#|d}t%|d}t%|d}t-||jd|jd|_t%|d}t-||jd|jd|_t#|d}t%|d} t5||jddd |jd|_nI#t8$r<t;||jdt=t?dd d!|_YnwxYwt%|d"} tA|d#|j $|_!t#|d} t%| d%} t-| |j d&|jd|_"t#|d} t%| d'}tG| |j d(d)d*d(|_$t#|d}t%|d+}t-||j d&|jd|_%tA|d,|j $|_&t#|d}t%|d-}t-||jd.|jd|_'|(tRd/d/tTtV0|(tRd/dtX1|(tZt\d/d/2|j(t^t\d/d/2|j(t^t\d/d/2|(tRd/dtX1|(tZt\d/d/2|j(t^t`dd/2|(t^t`d/3|j(t^t`dd/2|(t^t`d/3|(tRd/dtX1| (tZt\d/4|j(tZt\d4|j!(t^t`d5d/2| (tRd/dtX1| (tZt\d/d/2|j"(tRdd/6| (tRd/dtX1|(tZt\d/d/2|j$(tRdd/6|(tRd/dtX1|(tZt\d/4|j&(t^t`d5d/2|j%(tRt\d5d/2|(tRd/dtX1|(tZt\d/d/2|j'(tRdd/6d7S)8a1Return frame of widgets for Windows tab. Enable users to provisionally change general window options. Function load_windows_cfg initializes tk variable idleConf. Radiobuttons startup_shell_on and startup_editor_on set var startup_edit. Entry boxes win_width_int and win_height_int set var win_width and win_height. Setting var_name invokes the default callback that adds option to changes. Widgets for WinPage(Frame): > vars, bound to self frame_window: LabelFrame frame_run: Frame startup_title: Label startup_editor_on: Radiobutton > startup_edit startup_shell_on: Radiobutton > startup_edit frame_win_size: Frame win_size_title: Label win_width_title: Label win_width_int: Entry > win_width win_height_title: Label win_height_int: Entry > win_height frame_cursor: Frame indent_title: Label indent_chooser: Spinbox > indent_spaces blink_on: Checkbutton > cursor_blink frame_autocomplete: Frame auto_wait_title: Label auto_wait_int: Entry > autocomplete_wait frame_paren1: Frame paren_style_title: Label paren_style_type: OptionMenu > paren_style frame_paren2: Frame paren_time_title: Label paren_flash_time: Entry > flash_delay bell_on: Checkbutton > paren_bell frame_format: Frame format_width_title: Label format_width_int: Entry > format_width )r Generaleditor-on-startup)r r rJ)r r rI)r Indent num-spaces)r r  cursor-blink)rLr8 popupwait)rLr:rF)rLr: flash-delay)rLr:bell)rLr; max-widthrz Window Preferencesrrrz At StartuprlrzOpen Edit Windowrr7rmzOpen Shell Windowz$Initial Window Size (in characters)Widthrr textvariablerJvalidatecommandvalidateHeightzIndent spaces (4 is standard) )rfrom_torJrrreadonly )rrrWrJz Cursor Blinkz Cursor blink)rmrz%Completions Popup Wait (milliseconds)rzParen Match Style expressionopenerparensz;Time Match Displayed (milliseconds) (0 is until next input)zBell on MismatchzFormat Paragraph Max WidthrrrrrrqrrrrrN)1r\rr startup_editr win_width win_height indent_spacesr cursor_blinkautocomplete_wait paren_style flash_delay paren_bell format_widthr"rr!r&r)startup_editor_onstartup_shell_onr%r win_width_intwin_height_intr,indent_chooserr r-rurr$cursor_blink_bool auto_wait_intr'paren_style_typeparen_flash_timebell_onformat_width_intrr r rrrrr r)ra frame_window frame_run startup_titleframe_win_sizewin_size_titlewin_width_titlewin_height_title frame_cursor indent_titlecursor_blink_titleframe_autocompleteauto_wait_title frame_paren1paren_style_title frame_paren2paren_time_title frame_formatformat_width_titles rdrzWinPage.create_page_windowsspR$KKt FHH $!BDD!++$!CEE$[[$!ACC#KK4  "JLL!($!L"N"N";;$!FHH";;$!LNN!++4  "FHH#KK$!OQQ"$Af'<>>> ,A666 il;;; !,D$5Q'")")")!,D$5Q(!*!*!*|;;;%KMMMW==="T^1 $ 05   !h???#T_A $ 05    \q999 \"ACCC  I") t/A!$($4u#F#F#FD   I I I"* t/A$T%"++->->a#I#I#ID    I#>> ##qr#JJJSqqqAAA$qqqAAA Sr:::s;;;DCCC """1"===s;;;4::: uQRa@@@ ""ABQ"GGGs;;;T!!!DDD """1"=====s$%L AMMc|jtjdddd|jtjdddd|jtjddd d|jtjdd d d|jtjddd d|jtjd ddd|j tjd dd|j tjd ddd|j tjd dd|j tjd ddddS)Nr rrrr:r rJintrIrrrrLr8rr:rFrrr;r) rrr0rrrrrrrrrrrs rdrzWinPage.load_windows_cfgsM h0 #6VEEE F F F 8-e=== > > > H.u>>> ? ? ? x1,U < < < = = = h0VEEE F F F ""8#5nk$G$G$G H H H X/lG55 6 6 6 X/lMGGG H H H H.lF44 5 5 5 h0/5JJJ K K K K Kre)rrrrLrrrrrs@rdrrss     FFFh>h>h>TKKKKKKKrerc0eZdZfdZdZdZdZxZS)rct||||dSr)rrLrcreate_page_shedload_shelled_cfgrs rdrLzShedPage.__init__sW       recrtjdfd}||df|_dS)Nrc2|duSrrrs rdrz4ShedPage.init_validators..is_digits_or_emptyrrerrrs @rdrzShedPage.init_validatorsrrectt|d|_tt |d|_tt |d|_tt|d|_t|dtd}t|dtd}t|d }t|d }t|d |j|jd|_t|d }t|d }t!||jd d|_t!||jdd|_t|d }t|d }t'||jd|_t|d } t| d } t| |jd|jd|_|t.ddt0t||t.ddt0|t.dd t2|t4t6dd|jt.dd|t.dd t2|t4t6dd|jt8t6dd|jt8t6dd|t.dd t2|t4t6dd|jt4dd| t.dd t2| t4t6dd|jt.dddS)acReturn frame of widgets for Shell/Ed tab. Enable users to provisionally change shell and editor options. Function load_shed_cfg initializes tk variables using idleConf. Entry box auto_squeeze_min_lines_int sets auto_squeeze_min_lines_int. Setting var_name invokes the default callback that adds option to changes. Widgets for ShedPage(Frame): (*) widgets bound to self frame_shell: LabelFrame frame_auto_squeeze_min_lines: Frame auto_squeeze_min_lines_title: Label (*)auto_squeeze_min_lines_int: Entry - auto_squeeze_min_lines frame_editor: LabelFrame frame_save: Frame run_save_title: Label (*)save_ask_on: Radiobutton - autosave (*)save_auto_on: Radiobutton - autosave frame_format: Frame format_width_title: Label (*)format_width_int: Entry - format_width frame_line_numbers_default: Frame line_numbers_default_title: Label (*)line_numbers_default_bool: Checkbutton - line_numbers_default frame_context: Frame context_title: Label (*)context_int: Entry - context_lines )r PyShellauto-squeeze-min-lines)r rautosave)r r line-numbers-default)rLr9maxlinesrz Shell Preferencesrz Editor PreferencesrrzAuto-Squeeze Min. Lines:rlrr)rJrrrzAt Start of Run (F5) zPrompt to Saverrz No Promptz Show line numbers in new windows)rrJzMax Context Lines :rrrrrrN)r\rrauto_squeeze_min_linesrrrline_numbers_default context_linesr"rr!r&r%rauto_squeeze_min_lines_intr) save_ask_on save_auto_onr$line_numbers_default_bool context_intrr rrrrr ) ra frame_shell frame_editorframe_auto_squeeze_min_linesauto_squeeze_min_lines_title frame_saverun_save_titleframe_line_numbers_defaultline_numbers_default_title frame_context context_titles rdrzShedPage.create_page_sheds>'.kk$!N'P'P# t =?? $+KK4  @%B%B!%[[$!JLL!1V&:<<< !$Af'<>>> (-[a'H'H'H$',-I2L(N(N(N$*/,A!8 $ 05+ + + ' a $ 05    c=== d s>>>$))s)KKK$))tAAA)NNN ',,#AA,FFFSqqq999aaa@@@ E!!!DDD 5CCC"''Sqqq'III"''T!!!'LLL &++AA+FFF!!!<<<QQQ??? 3QQ77777rec |jtjdddd|jtjddddd |jtjdd d d |jtjd ddddS)Nr rrrrrrrr)rr:r rrLr9r)rrr0rrrrrs rdrzShedPage.load_shelled_cfgYs  #''(: #;%)I)I)I J J J (, :qvGGG H H H !%%h&8(>V'M'M'M N N N x1mZe E E E F F F F Fre)rrrrLrrrrrs@rdrrss     FFFf8f8f8P F F F F F F FrercBeZdZfdZdZdZdZdZdZdZ xZ S)rxc4t|tjd|_tjd|_|t|_| | dS)NrL) rrLr0rext_defaultCfgr  ext_userCfgris_intload_extensionscreate_page_extensionsrs rdrLzExtPage.__init__gsx    &1,?#+L9mmF++   ##%%%%%rect||_t|dtd}t |dtd|_|dd|ddt||jd |_ |j d |j t||j j }|j|j _t|d d |_|j ddd|ddd|jdddddg|di|_d|_||_|j |_d}t/|jD]"}|||dz|zdz}#|j||j d| d|dddt7|dd|jddddS)aConfigure IDLE feature extensions and help menu extensions. List the feature extensions and a configuration box for the selected extension. Help menu extensions are in a HelpFrame. This code reads the current configuration using idleConf, supplies a GUI interface to change the configuration values, and saves the changes using idleConf. Some changes 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: 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(). rz Feature Extensions rz Help Menu Extensions rrrbrowse) listvariable selectmodez<>r)rJrInwsrrrknsrr)rrrkrrhNr@{z} r')rrsew)rextension_namesr"r HelpFrame frame_helprrrextension_listrextension_selectedr*rrr details_framervr config_framecurrent_extension outerframetabbed_page_setr#rLcreate_extension_frame selection_setr&)ra frame_extscroll ext_namesrQs rdrzExtPage.create_page_extensionsosv0 )t6$:<<< #Da$<>>> q+++!!!A!...%id>R19;;;   !4d6MNNN9d.A.GHHH+1:*' SIII   q ??? 1!D 111 qab!WMMMB'''!%#2 t// : :H  ' ' 1 1 1!C(2T9II   +++ ))!,,, %%% 1Qv666 d Qq))) 1U;;;;;rec i|_tjdD] }g|j|< |jD]G}t|j|}d|D}|D]}||||z}|D]}|j||d} ddd|}d}n7#t$r* t|}d}n#t$r|}d }YnwxYwYnwxYw |j |||d| }n#t$r|}YnwxYwt|} | t||j|||||| d Id S) zAFill self.extensions with data from the default and user configs.F) active_onlyc<g|]}|d|S)enable) startswith)ropt_names rdrz+ExtPage.load_extensions..s:999H"--h779x999reT)raw)TrueFalserrN)r:rr)r;r:rr7var)rLr0 GetExtensionsr#r GetOptionListremoverKeyErrorrr+rrrrappend) rarQopt_listenablesrdef_strdef_objopt_typer7r!s rdrzExtPage.load_extensionss! .5AAA + +H(*DOH % %% 4% 4Hd1??IIJJH99999G# * *)))))H$ 4 4-11 (266 (&*E::7CG%HH(((("%g,,#(%(((")#'( ($ ,00$hX4$+1--EE"$$$#EEE$ooE ###)00(:B=D;@9< 23234444- 4% 4% 4sH( B66 C*CC*C$ !C*#C$ $C*)C*.D DDc|j}|r|j|}| ||jkrM|jrF|jd|j|jd|_|rG|j||j|ddd||_dSdS)z/Handle selection of an extension from the list.Nr@rlrrr) r rtrrrrr grid_forgetrv)rar<newsels rdr zExtPage.extension_selecteds$1133  5(,,V44F >Vt'===% ."))r)222!$"89EEGGG)-&  ,   % %6 % 2 2 2  f % * *!6 * J J J%+D " " " , ,reclt|jdd}||j|<|j}t |j|D]\}}t ||d}||dt|d}|dd kr1t||d d d |dtd~|ddkr8t||d|j dfd|dtdt||d|dtddS)z=Create a frame holding the widgets to configure one extensionrrHr;rlrr'r!r:rrr r)rrrrJr)rrrkrrrrr)rrrrJr)rrJN)VerticalScrolledFramerrinterior enumeraterLr&rvrr$rr%rr)rarQf entry_arearoptlabelr!s rdrzExtPage.create_extension_framesW !$"4S L L L&'(#Z !$/(";<< E EHC*3v;777E JJ3qJ 4 4 4e*C6{f$$J$*WA"ds1QQdGGGGV%%jsU'+{D&9Qt!DDDDjs"Qt!DDDDrec.|d}|d}|dp|}|d|||kr|j||S|j|||S)zReturn 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;rr!)rrrr RemoveOptionr)rasectionr6r;rr7s rdset_extension_valuezExtPage.set_extension_values 6{i.E   &&((3G E u W  #00$?? ?))'4???recd}|jD],}|j|}|D]}|||rd}-|r|jdSdS)zSave configuration changes to the user config file. Attributes accessed: extensions Methods: set_extension_value FTN)rLr;rSave)ra has_changesrQoptionsr6s rdrz#ExtPage.save_all_changed_extensionss  ' 'Hoh/G ' '++Hc::'"&K '  $   ! ! # # # # # $ $re) rrrrLrrr rr;rrrs@rdrxrxfs&&&&&=<=<=<~,4,4,4\ , , ,4@@@"$$$$$$$rerxcNeZdZfdZdZdZdZdZdZdZ dZ d Z xZ S) r c tj|fi|||dSr)rrLcreate_frame_help load_helplist)rarcfgrs rdrLzHelpFrame.__init__+sL''3'''     rect|}t|ddt|_t |}|jj|d<|j|jd<|jd|jt|}t|ddd |j |_ t|d d |j |_ t|d dd |j |_|t"ddt$t&|jt"t(t$t&|t*t,t.|t*ddt.|j t0t,d|j t0t,|jt0t,ddS)a8Create LabelFrame for additional help menu sources. load_helplist loads list user_helplist with name, position pairs and copies names to listbox helplist. Clicking a name invokes help_source selected. Clicking button_helplist_name invokes helplist_item_name, which also changes user_helplist. These functions all call set_add_delete_state. All but load call update_help_changes to rewrite changes['main']['HelpFiles']. Widgets for HelpFrame(LabelFrame): (*) widgets bound to self frame_helplist: Frame (*)helplist: ListBox scroll_helplist: Scrollbar frame_buttons: Frame (*)button_helplist_edit (*)button_helplist_add (*)button_helplist_remove rTrrrrEditrr)rmrrJrAdd)rmrJrRemover)rqrrrrs)rqrrsrrrN)r!rr helplistr*rrrhelp_source_selectedr#helplist_item_editbutton_helplist_edithelplist_item_addbutton_helplist_addhelplist_item_removebutton_helplist_removerrr rrr rrr )raframe_helplistscroll_helplist frame_buttonss rdrBzHelpFrame.create_frame_help0s*tqD %''' $N33%)]%8 "*9*= &' .0IJJJd $*F*!8%:%:%:!$*E!7$9$9$9 '-HJ!:'<'<'<# AAdNNN Qt$GGG%:::AAA>>> !&&C&BBB  %%3q%999 #((c!!(DDDDDrec.|dS)z+Handle event for selecting additional help.N)set_add_delete_staterhs rdrJzHelpFrame.help_source_selectedbrrec|jdkr6|jd|jddS|jr6|jd|jddS|jd|jddS)zAToggle the state for the help list buttons based on list entries.rrrN)rIsizerLrrPrtrs rdrUzHelpFrame.set_add_delete_statefs =    ! # #  % + +M : : :  ' - -m < < < < <}))++ A)//???+11.AAAAA)// >>>+11-@@@@@rect|dj}|rV|j||jt |d|dSdS)zHandle add button for the help list. Query for name and location of new help sources and add them to the list. zNew Help SourcerN)r6r user_helplistr&rIrrupdate_help_changes)ra help_sources rdrMzHelpFrame.helplist_item_addsst !'899@  '   % %k 2 2 2 M k!n 5 5 5  $ $ & & & & & ' 'rec|jt}|j|}t |d|d|dj}|ru||krq||j|<|j||j||d|| dSdSdS)zHandle edit button for the help list. Query with existing help source information and update config if the values are changed. zEdit Help Sourcerr)menuitemfilepathN) rIr&rrYr6rrZrrZrU)ra item_indexr[new_help_sources rdrKzHelpFrame.helplist_item_edits ]((00 (4 $($Q$Q   (+==-.default_callbacks-   2 2 2 2 2 2 2 2rer )r!rrws`` rdrrzVarTrace.make_callbacks* 3 3 3 3 3 3 rec|jrW|j\}}|d||j||f|jUdSdS)z0Attach callback to all vars that are not traced.writeN)rlpop trace_addrmr&rss rdr]zVarTrace.attachsqm 0 M--//MC MM'8 , , , K  X / / /m 0 0 0 0 0rec|jru|j\}}|d|dd|j||f|jsdSdS)z!Remove callback from traced vars.ryrrN)rmrz trace_remove trace_inforlr&rss rddetachzVarTrace.detachsk 2 KOO--MC   Wcnn&6&6q&9!&< = = = M #x 1 1 1k 2 2 2 2 2reN) rrrrrLrrr|rrr]rr rerdrjrjs,,    "  \ 00022222rerja7When 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 milliseconds 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". a ZzDummy: This extension is provided as an example for how to create and use an extension. Enable indicates whether the extension is active or not; likewise enable_editor and enable_shell indicate which windows it will be active on. For this extension, z-text is the text that will be inserted at or removed from the beginning of the lines of selected text, or the current line if no selection. )z Fonts/Tabsrnr@rrocP|sdS t|dS#t$rYdSwxYw)z(Return 's is blank or represents an int'TF)rr+)rs rdrr3 sF t At uus  %%ceZdZdZdZdS)r1zA 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 c tj||g|Ri|t|t}|t t tt|dd|j dttt| jddtx|_ddt& fd }d | fd }d |dS) Nr )rsrqrrr)rrirrJr(r)windowrcf}d|zdS)Nz 0 0 %s %s) scrollregion)winfo_reqwidthwinfo_reqheightr)r<rWcanvasr2s rd_configure_interiorz;VerticalScrolledFrame.__init__.._configure_interiorZ sD++--x/G/G/I/IJD MM{T'9M : : : : :rez ckr+dSdS)N)rJ)r winfo_width itemconfigure)r<rr2 interior_ids rd_configure_canvasz9VerticalScrolledFrame.__init__.._configure_canvas` sZ&&((F,>,>,@,@@@$$[8J8J8L8L$MMMMMA@re)r!rLr*rrrr r rrrrr rr xview_moveto yview_movetor2 create_windowrr) rarMrkw vscrollbarrrrr2rs @@@rdrLzVerticalScrolledFrame.__init__E s} tV1d111b111tH555 QU5999!'1~SBBB D 666&,/// AA$)==0 **1a*LL  ; ; ; ; ; ;  m%8999 N N N N N N N  M#4555reN)rrrrrLr rerdr1r1> s- !!!!!rer1__main__)r z#idlelib.idle_test.test_configdialogrF) verbosityexit)run)crrtkinterrrrrrrr r r r r rrrrrrrrrrrrrrrrrrr tkinter.ttkr!r"r#r$r%r&r'r(r)r*r+r,r-r. tkinter.fontr0r$r/idlelib.configr0r1idlelib.config_keyr2idlelib.dynoptionr3idlelibr4 idlelib.queryr5r6idlelib.textviewr7idlelib.autocompleter8idlelib.codecontextr9idlelib.parenmatchr:idlelib.formatr;idlelib.squeezerr<r=rrr?rr|rzr}rrrxr rjr\rrrr1runittestr idlelib.idle_test.htestrr rerdrs"   JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,! 22222222,,,,,,++++++11111111&&&&&&------++++++))))))******%%%%%%000000 -//[*o BBBBB8BBBlE