Ë ðEFräPÙðãó4—dZddlmZddlZddlZddlmZddlZGd„de«Z Gd„de«Z Gd „d e«Z Gd „d e«Z Gd „de «Z Gd„d«Ze«Ze«Zd„ZGd„de«Zd„Zedk(rddlmZeddd¬«e«yy)aDidlelib.config -- Manage IDLE configuration information. The comments at the beginning of config-main.def describe the configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will be removed from the user's configuration files, and if a user file becomes empty, it will be deleted. The configuration database maps options to values. Conceptually, the database keys are tuples (config-type, section, item). As implemented, there are separate dicts for default and user values. Each has config-type keys 'main', 'extensions', 'highlight', and 'keys'. The value for each key is a ConfigParser instance that maps section and item to values. For 'main' and 'extensions', user values override default values. For 'highlight' and 'keys', user sections augment the default sections (and must, therefore, have distinct names). Throughout this module there is an emphasis on returning usable defaults when a problem occurs in returning a requested configuration value back to idle. This is to allow IDLE to continue to function in spite of errors in the retrieval of config information. When a default is returned instead of a requested config value, a message is printed to stderr to aid in configuration problem notification and resolution. é)Ú ConfigParserN)ÚFontcó —eZdZy)ÚInvalidConfigTypeN©Ú__name__Ú __module__Ú __qualname__©óú%/usr/lib/python3.12/idlelib/config.pyrr#ó…r rcó —eZdZy)ÚInvalidConfigSetNrr r r rr$rr rcó —eZdZy)Ú InvalidThemeNrr r r rr%rr rcó,—eZdZdZdd„Zdd„Zd„Zd„Zy) ÚIdleConfParserzI A ConfigParser specialised for idle configuration file handling NcóB—||_tj||d¬«y)zK cfgFile - string, fully specified configuration file name F)ÚdefaultsÚstrictN)ÚfilerÚ__init__)ÚselfÚcfgFileÚ cfgDefaultss r rzIdleConfParser.__init__+s€ðˆŒ Ü×јd¨[ÀÖGr có®—|j||«s|S|dk(r|j||«S|dk(r|j||«S|j|||¬«S)z Get an option value for given section/option or return default. If type is specified, return as type. ÚboolÚint©Úraw)Ú has_optionÚ getbooleanÚgetintÚget)rÚsectionÚoptionÚtypeÚdefaultr!s r ÚGetzIdleConfParser.Get2s\€ð�‰˜w¨Ô/؈NØ �6Š>Ø—?‘? 7¨FÓ3Ð 3Ø �UŠ]Ø—;‘;˜w¨Ó/Ð /à—8‘8˜G V°�8Ó5Ð 5r cóJ—|j|«r|j|«SgS)z4Return a list of options for given section, else [].)Ú has_sectionÚoptions©rr&s r Ú GetOptionListzIdleConfParser.GetOptionListCs$€à × Ñ ˜GÔ $Ø—<‘< Ó(Ð (àˆIr cóT—|jr|j|j«yy)z&Load the configuration file from disk.N)rÚread©rs r ÚLoadzIdleConfParser.LoadJs€à �9Š9Ø �I‰I�d—i‘iÕ ð r ©N)NNF)rr r Ú__doc__rr*r/r3r r r rr's„ñóHó6ò"ó!r rcó4—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z y) ÚIdleUserConfParserzG IdleConfigParser specialised for user configuration handling. cóæ—|j||«r*|j||«|k(ry|j|||«y|j|«s|j |«|j|||«y)z‘Return True if option is added or changed to value, else False. Add section if required. False means option already had value. FT)r"r%Úsetr,Ú add_section)rr&r'Úvalues r Ú SetOptionzIdleUserConfParser.SetOptionTsj€ð �?‰?˜7 FÔ +Ø�x‰x˜ Ó(¨EÒ1Øà—‘˜ &¨%Ô0Øà×#Ñ# GÔ,Ø× Ñ  Ô)Ø �H‰H�W˜f eÔ ,Ør cóJ—|j|«r|j||«Sy)z‹Return True if option is removed from section, else False. False if either section does not exist or did not have option. F)r,Ú remove_option)rr&r's r Ú RemoveOptionzIdleUserConfParser.RemoveOptiones(€ð × Ñ ˜GÔ $Ø×%Ñ% g¨vÓ6Ð 6Ør cóJ—|j|«s|j|«yy)z!If section doesn't exist, add it.N)r,r:r.s r Ú AddSectionzIdleUserConfParser.AddSectionns#€à×Ñ Ô(Ø × Ñ ˜WÕ %ð)r cót—|j«D]%}|j|«rŒ|j|«Œ'y)z)Remove any sections that have no options.N)Úsectionsr/Úremove_sectionr.s r ÚRemoveEmptySectionsz&IdleUserConfParser.RemoveEmptySectionsss.€à—}‘}–ˆGØ×%Ñ% gÕ.Ø×#Ñ# GÕ,ñ'r cóD—|j«|j« S)z9Return True if no sections after removing empty sections.)rErCr2s r ÚIsEmptyzIdleUserConfParser.IsEmptyys€à × Ñ Ô"Ø—=‘=“?Ð"Ð"r có²—|j}|r�|ddk7r„|j«s* t|d«}|5|j |«ddd«ytjj|j«r t j|j«yyyy#t$r$t j |«t|d«}YŒ•wxYw#1swYyxYw)zµUpdate user configuration file. If self not empty after removing empty sections, write the file to disk. Otherwise, remove the file from disk if it exists. rÚ#ÚwN) rrGÚopenÚOSErrorÚosÚunlinkÚwriteÚpathÚexistsÚremove)rÚfnamers r ÚSavezIdleUserConfParser.Save~s­€ð — ‘ ˆÙ �U˜1‘X ’_Ø—<‘<”>ð/Ü" 5¨#Ó.�GòØ—J‘J˜wÔ'÷�Wä—‘—‘ § ¡ Ô*Ü— ‘ ˜$Ÿ)™)Õ$ð+ð%ˆ5øôò/Ü—I‘I˜eÔ$Ü" 5¨#Ó.’Gð/ú÷�Wús¨ B¶C Â*C à C à CN) rr r r5r<r?rArErGrTr r r r7r7Os%„ñòò"ò&ò -ò #ó %r r7cóÚ—eZdZdZd d„Zd„Zd„Z d!d„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zed„«Z d"d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zhd£Zd#d„Zd„Zd„Zd„Zd„Z d„Z!y)$ÚIdleConfalHold config parsers for all idle config files in singleton instance. Default config files, self.defaultCfg -- for config_type in self.config_types: (idle install dir)/config-{config-type}.def User config files, self.userCfg -- for config_type in self.config_types: (user home dir)/.idlerc/config-{config-type}.cfg có‚—d|_i|_i|_i|_|s!|j «|j «yy)N)ÚmainÚ highlightÚkeysÚ extensions)Ú config_typesÚ defaultCfgÚuserCfgÚcfgÚCreateConfigHandlersÚ LoadCfgFiles)rÚ_utests r rzIdleConf.__init__œsA€ØGˆÔ؈ŒØˆŒ ؈Œñ Ø × %Ñ %Ô 'Ø × Ñ Õ ðr c ó®—tjjt«}tj rdn|j «x|_}|jD]z}ttjj|d|›d�««|j|<ttjj|xsdd|›d�««|j|<Œ|y)z5Populate default and user config parser dictionaries.Úzconfig-z.defrIz.cfgN)rMrPÚdirnameÚ__file__ÚidlelibÚtestingÚ GetUserCfgDirÚuserdirr\rÚjoinr]r7r^)rÚidledirrjÚcfg_types r r`zIdleConf.CreateConfigHandlers©s£€ä—'‘'—/‘/¤(Ó+ˆÜ'.§¢¡¸D×Ó?ó)AˆD�O‰O˜HÑ %ä%7Ü—‘— ‘ ˜Wš^¨¨w°x°jÀÐ-EÓFó&HˆD�L‰L˜Ò "ñ*r có¼—d}tjjd«}|dk7rUtjj|«s6tj s$d|zdz} t |tj¬«d}|dk(rtj«}tjj||«}tjj|«s tj|«|S|S#t$rYŒwxYw#t$rUtj s>d|zdz} t |tj¬«t‚#t$rYt‚wxYwt‚wxYw)zfReturn a filesystem directory for storing user config files. Creates it if required. z.idlercÚ~z. Warning: os.path.expanduser("~") points to z, but the path does not exist.©rz2 Warning: unable to create user config directory z( Check path and permissions. Exiting! )rMrPÚ expanduserrQrgrhÚprintÚsysÚstderrrLÚgetcwdrkÚmkdirÚ SystemExit)rÚcfgDirÚuserDirÚwarns r rizIdleConf.GetUserCfgDir³s9€ð ˆÜ—'‘'×$Ñ$ SÓ)ˆØ �cŠ>Ü—7‘7—>‘> 'Ô*Ü—’ØNØ#ñ$Ø&HñI�Dðܘd¬¯©Õ4ð�Ø �cŠ>ä—i‘i“kˆGÜ—'‘'—,‘,˜w¨Ó/ˆÜ�w‰w�~‰~˜gÔ&ð !Ü—‘˜Ô!ðˆˆwˆøô)#òÙðûôò !Ü—’ØRØ#ñ$Ø&SñT�Dðܘd¬¯©Õ4ô!Ð øô#òØÜ Ð ðúä Ð ð !úsBÁC.ÃC=Ã. C:Ã9C:Ã=!EÄEÄ:EÅ EÅ EÅEÅ ENc óú— |j|j||«r"|j|j||||¬«S |j |j||«r"|j |j||||¬«S |rd|›d|›d|›�}t ||||«|S#t$r>d|›d|›d|›d|j|j|||¬«›�}t ||||«YŒ¦wxYw#t$rYŒrwxYw) aReturn a value for configType section option, or default. If type is not None, return a value of that type. Also pass raw to the config parser. First try to return a valid value (including type) from a user configuration. If that fails, try the default configuration. If that fails, return default, with a default of None. Warn if either user or default configurations have an invalid value. Warn if default is returned and warn_on_default is True. )r(r!z5 Warning: config.py - IdleConf.GetOption - invalid z value for configuration option z from section z: r zU Warning: config.py - IdleConf.GetOption - problem retrieving configuration option ú. returning default value: )r^r"r*Ú ValueErrorÚ_warnr]) rÚ configTyper&r'r)r(Úwarn_on_defaultr!Úwarnings r Ú GetOptionzIdleConf.GetOption×s-€ð 8Ø�|‰|˜JÑ'×2Ñ2°7¸FÔCØ—|‘| JÑ/×3Ñ3°G¸VØ9=À3ð4óHðHðDð Ø�‰˜zÑ*×5Ñ5°g¸fÔEØ—‘ zÑ2×6Ñ6Ø ¨d¸ð7ó=ð=ðFò ò ¢©ð 2ˆGô �'˜: w°Ô 7؈øô+ó 8òšf¢gØ—|‘| JÑ/×3Ñ3°G¸VÈÐ3ÔMð OˆGô �'˜: w°Ö 7ð  8ûôò Ù ð ús&‚AB$ÁAC.Â$AC+Ã*C+Ã. C:Ã9C:cóD—|j|j|||«y)z0Set section option to value in user config file.N)r^r<)rrr&r'r;s r r<zIdleConf.SetOptionÿs€à � ‰ �ZÑ ×*Ñ*¨7°F¸EÕBr cóÚ—||jvr td«‚|dk(r|j|}|j «S|dk(r|j|}|j «St d«‚)z§Return sections for configSet configType configuration. configSet must be either 'user' or 'default' configType must be in self.config_types. zInvalid configType specifiedÚuserr)úInvalid configSet specified)r\rr^r]rrC)rÚ configSetrÚ cfgParsers r ÚGetSectionListzIdleConf.GetSectionLists|€ð ˜d×/Ñ/Ñ/Ü#Ð$BÓCÐ CØ ˜Ò ØŸ ™  ZÑ0ˆIð ×!Ñ!Ó#Ð#ð ˜)Ò #Ø—o‘o jÑ1ˆIð×!Ñ!Ó#Ð#ô#Ð#@ÓAÐ Ar có¢—|jdj|«rdnd}|j||«}||dz}|dk(rd}||dz}||dœS) zÀReturn dict of theme element highlight colors. The keys are 'foreground' and 'background'. The values are tkinter color strings for configuring backgrounds and tags. rYr)r…z -foregroundÚcursorÚnormalz -background)Ú foregroundÚ background)r]r,Ú GetThemeDict)rÚthemeÚelementr_Ú theme_dictÚforeÚbacks r Ú GetHighlightzIdleConf.GetHighlightsm€ð !ŸO™O¨KÑ8×DÑDÀUÔK‰yØð à×&Ñ& s¨EÓ2ˆ ؘ' MÑ1Ñ2ˆØ �hÒ ØˆGؘ' MÑ1Ñ2ˆØ"°$Ñ7Ð7r có¼—|dk(r|jd}n |dk(r|jd}n td«‚idd“dd“d d“d d“d d“d d“d d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dddddddddddddddœ¥}|D][}|j||«s-|j d«sd|›d|›d||›�}t |d||«|j ||||¬«||<Œ]|S)a)Return {option:value} dict for elements in themeName. type - string, 'default' or 'user' theme type themeName - string, theme name Values are loaded over ultimate fallback defaults to guarantee that all theme elements are present in a newly created theme. r…rYr)zInvalid theme type specifiedznormal-foregroundz#000000znormal-backgroundz#ffffffzkeyword-foregroundzkeyword-backgroundzbuiltin-foregroundzbuiltin-backgroundzcomment-foregroundzcomment-backgroundzstring-foregroundzstring-backgroundzdefinition-foregroundzdefinition-backgroundzhilite-foregroundzhilite-backgroundÚgrayzbreak-foregroundzbreak-backgroundzhit-foreground)zhit-backgroundzerror-foregroundzerror-backgroundzcontext-foregroundzcontext-backgroundzlinenumber-foregroundzlinenumber-backgroundzcursor-foregroundzstdout-foregroundzstdout-backgroundzstderr-foregroundzstderr-backgroundzconsole-foregroundzconsole-background)zcontext-z linenumber-zL Warning: config.IdleConf.GetThemeDict - problem retrieving theme element z from theme z. returning default color: ©r))r^r]rr"Ú startswithr~r*)rr(Ú themeNamerˆr�r‘r�s r r�zIdleConf.GetThemeDict"sµ€ð �6Š>ØŸ ™  [Ñ1‰IØ �YÒ ØŸ™¨ Ñ4‰IäÐ=Ó>Ð >ð !Ð# Ið!Ø# Ið!à$ Yð!ð% Yð!ð% Yð !ð % Yð !ð % Yð !ð% Yð!ð$ Ið!ð$ Ið!ð(¨ ð!ð(¨ ð!ð$ Ið!ð$ Fð!ð# 9ð!ð# 9ð!ð ! ð!!ð""+Ø#,Ø#,Ø%.Ø%.Ø(1Ø(1à$-à$-Ø$-Ø$-Ø$-Ø%.Ø%.òA!ˆóDˆGØ×(Ñ(¨°GÔ<à×&Ñ&Ð'BÕCò $¢Y°°g²ð @�ô �g˜{¨I°wÔ?Ø&Ÿ]™]ؘw°°g±ð+ó@ˆE�'ŠNððˆ r có$—|jd«S)z9Return the name of the currently active text color theme.ÚTheme©Úcurrent_colors_and_keysr2s r Ú CurrentThemezIdleConf.CurrentThemefs€à×+Ñ+¨GÓ4Ð4r có$—|jd«S)z0Return the name of the currently active key set.ÚKeysr�r2s r Ú CurrentKeyszIdleConf.CurrentKeysjs€à×+Ñ+¨FÓ3Ð3r có2—|dk(rdnd}|jd|ddd¬«}d }|r|jd|d d ¬ «}|s|jd|d d ¬ «}|r0|r |jn |j}||j|«r|S|dk(rd S|j «S)aReturn the currently active name for Theme or Keys section. idlelib.config-main.def ('default') includes these sections [Theme] default= 1 name= IDLE Classic name2= [Keys] default= 1 name= name2= Item 'name2', is used for built-in ('default') themes and keys added after 2015 Oct 1 and 2016 July 1. This kludge is needed because setting 'name' to a builtin not defined in older IDLEs to display multiple error messages or quit. See https://bugs.python.org/issue25313. When default = True, 'name2' takes precedence over 'name', while older IDLEs will just use name. When default = False, 'name2' may still be set, but it is ignored. rœrYrZrXr)rT©r(r)rdÚname2r˜Únamez IDLE Classic)r‚r]r^r,Ú default_keys)rr&Úcfgnamer)r¦Úsources r ržz IdleConf.current_colors_and_keysns­€ð0")¨GÒ!3‘+¸ˆØ—.‘. ¨°)Ø&,°dð!ó<ˆàˆÙ Ø—>‘> &¨'°7ÀB�>ÓGˆDÙØ—>‘> &¨'°6À2�>ÓFˆDÙ Ù(/�T—_’_°T·\±\ˆFØ�g‰×*Ñ*¨4Ô0Ø� Ø!(¨GÒ!3ˆ~ÐL¸×9JÑ9JÓ9LÐLr cóZ—tjdddk(rytjdk(ryy)NéÚwinzIDLE Classic WindowsÚdarwinzIDLE Classic OSXzIDLE Modern Unix)rsÚplatformr r r r§zIdleConf.default_keys”s*€ä �<‰<˜˜Ð ˜uÒ $Ø)Ü �\‰\˜XÒ %Ø%à%r c óÈ—|j|jdd««}|j|jdd««}|D]}||vsŒ|j|«ŒdD]}|j|«Œ|rhg}|D]_}|j d|ddd¬«sŒ|s|r1|rd }nd }|j d||ddd ¬ «sŒ=|j|«ŒO|j|«Œa|S|S) zúReturn extensions in default and user config-extensions files. If active_only True, only return active (enabled) extensions and optionally only editor or shell extensions. If active_only False, return all extensions. r)r[r…)Ú AutoCompleteÚ CodeContextÚFormatParagraphÚ ParenMatchÚenableTr©r)r(Ú enable_editorÚ enable_shellF)r)r(r€)ÚRemoveKeyBindNamesr‰ÚappendrRr‚) rÚ active_onlyÚ editor_onlyÚ shell_onlyÚextnsÚ userExtnsÚextnÚ activeExtnsr's r Ú GetExtensionszIdleConf.GetExtensions�s €ð×'Ñ'Ø×#Ñ# I¨|Ó<ó>ˆà×+Ñ+Ø×#Ñ# F¨LÓ9ó;ˆ ãˆDؘ5Ò Ø— ‘ ˜TÕ"ðó5ˆDà �L‰L˜Õ ð5ñ ؈KÛ�Ø—>‘> ,°°hÈØ'-ð"õ/ñ#¡jÙ&Ø%4™Fà%3˜FØŸ>™>¨,¸¸VØ26¸VØ:?ð*õAð(×.Ñ.¨tÕ4à#×*Ñ*¨4Õ0ððÐ àˆLr cóP—|D�cgc]}|jd«rŒ|‘Œc}Scc}w)z:Return extnNameList with keybinding section names removed.)Ú _bindingsÚ _cfgBindings)Úendswith)rÚ extnNameListÚns r r¸zIdleConf.RemoveKeyBindNamesÆs&€á'ÓY™<�a¨q¯z©zÐ:WÕ/X’˜<ÑYÐYùÒYs…#œ#có„—d}d|zdz}|jd¬«D] }|j|«D] }||k(sŒ |}Œ Œ"|S)zÄReturn the name of the extension binding virtualEvent, or None. virtualEvent - string, name of the virtual event to test for, without the enclosing '<< >>' Nú<<ú>>r©rº)rÁÚGetExtensionKeys)rÚ virtualEventÚextNameÚvEventr¿Úevents r ÚGetExtnNameForEventzIdleConf.GetExtnNameForEventÊsX€ð ˆØ˜ Ñ$ tÑ+ˆØ×&Ñ&°1Ð&Ö5ˆDØ×.Ñ.¨tÖ4�ؘF“?Ø"‘Gñ5ð6ðˆr cóÞ—|dz}|j«}i}|jdj|«r7|jdj|«}|D]}d|zdz}||}|||<Œ|S)a Return dict: {configurable extensionName event : active keybinding}. Events come from default config extension_cfgBindings section. Keybindings come from GetCurrentKeySet() active key dict, where previously used bindings are disabled. rÄr[rÉrÊ)ÚGetCurrentKeySetr]r,r/) rÚ extensionNameÚkeysNameÚ activeKeysÚextKeysÚ eventNamesÚ eventNamerÐÚbindings r rÌzIdleConf.GetExtensionKeysØs„€ð! >Ñ1ˆØ×*Ñ*Ó,ˆ ØˆØ �?‰?˜<Ñ (× 4Ñ 4°XÔ >ØŸ™¨Ñ6×DÑDÀXÓNˆJÛ'� ؘyÑ(¨4Ñ/�Ø$ UÑ+�Ø!(�˜’ð(ðˆr cóú—|dz}i}|jdj|«rU|jdj|«}|D]2}|jd||d¬«j «}d|zdz}|||<Œ4|S)aReturn dict {configurable extensionName event : keybinding list}. Events come from default config extension_cfgBindings section. Keybindings list come from the splitting of GetOption, which tries user config before default config. rÄr[rdr˜rÉrÊ)r]r,r/r‚Úsplit)rrÔrÕr×rØrÙrÚrÐs r Ú__GetRawExtensionKeyszIdleConf.__GetRawExtensionKeysês“€ð! Ñ/ˆØˆØ �?‰?˜<Ñ (× 4Ñ 4°XÔ >ØŸ™¨Ñ6×DÑDÀXÓNˆJÛ'� ØŸ.™.Ø$ h° À2ð)óGßGLÁuÃwðà˜yÑ(¨4Ñ/�Ø!(�˜’ð (ð ˆr có—|dz}|j|«}|jdj|«rU|jdj|«}|D]2}|j d||d¬«j «}d|zdz}|||<Œ4|S)aReturn dict {extensionName event : active or defined keybinding}. Augment self.GetExtensionKeys(extensionName) with mapping of non- configurable events (from default config) to GetOption splits, as in self.__GetRawExtensionKeys. rÃr[rdr˜rÉrÊ)rÌr]r,r/r‚rÜ)rrÔÚ bindsNameÚextBindsrØrÙrÚrÐs r ÚGetExtensionBindingszIdleConf.GetExtensionBindingsüsž€ð" KÑ/ˆ Ø×(Ñ(¨Ó7ˆà �?‰?˜<Ñ (× 4Ñ 4°YÔ ?ØŸ™¨Ñ6×DÑDÀYÓOˆJÛ'� ØŸ.™.Ø$ i°ÀBð)óHßHMÉËðà˜yÑ(¨4Ñ/�Ø")�˜’ð (ð ˆr cóX—|dd}|jd||dd¬«j«}|S)zÊReturn the keybinding list for keySetName eventStr. keySetName - name of key binding set (config-keys section). eventStr - virtual event, including brackets, as in '<>'. ééþÿÿÿrZrdF)r)r€)r‚rÜ)rÚ keySetNameÚeventStrrÙrÚs r Ú GetKeyBindingzIdleConf.GetKeyBindings<€ð ˜Q˜r�Nˆ Ø—.‘. ¨°YÈØ16ð!ó8ß8=¹»ð àˆr cóø—|j|j««}tjdk(rB|j «D]/\}}|D�cgc]}|j dd«‘Œ}}||k7sŒ+|||<Œ1|Scc}w)z/Return CurrentKeys with 'darwin' modifications.r­z>' rÉrÊ)ró)rrÍs r Ú IsCoreBindingzIdleConf.IsCoreBinding>s"€ð �\Ñ! $Ñ&¨4×+;Ñ+;Ó+=Ð=Ð=r > ú<>ú<>ú<>ú<>ú<>ú<>ú<>ú<>ú<>c ó—idddg“dddg“ddd g“d d d g“d dg“ddg“ddg“ddg“ddg“ddg“ddg“ddg“ddg“ddg“dd g“d!d"g“d#d$g“id%d&g“d'd(g“d)d*g“d+d,g“d-d.g“d/d0g“d1d2g“d3d4g“d5d6g“d7d8g“d9d:g“d;dg“d?d@dAg“dBdCg“dDdEg“dFdGg“¥idHdIg“dJdKg“dLdMg“dNdOdPg“dQdRg“dSdTg“dUdVg“dWdXg“dYdZg“d[d\g“d]d^g“d_d`g“dadbg“dcddg“dedfg“dgdhg“didjg“¥dkgdlgdmgdngdogdpgdqgdrœ¥}|r�|jdsj|«s3|jdsj|«sdt|›du�}t|ds|«|S|D]G}|j ||«}|r|||<Œ||j vsŒ,dv|›dw|›dx||›�}t|ds||«ŒI|S)yašReturn dict of core virtual-key keybindings for keySetName. The default keySetName None corresponds to the keyBindings base dict. If keySetName is not None, bindings from the config file(s) are loaded _over_ these defaults, so if there is a problem getting any core binding there will be an 'ultimate last resort fallback' to the CUA-ish bindings defined here. z<>z z z<>z z z <>z z z<>z zz<>z z<>z z<>zz<>z<>z z<>zz<>z z<>zz<>zz<>z<>zz<>z z<>zz<>zz<>z z<>z z<>z z<>z z<>z z<>zz<>z z<>zz<>z z<>zz<>zz<>z z<>z zz<>zz<>z z<>z z <>z z <>zz<>zz<>z zz<>z z<>zz<>zz<>z z<>z z<>z z<>z z<>z z<>z z<>zz<>zrzrûzzzz zzz z )rrürÿrúrùrþrýrZz7 Warning: config.py - IdleConf.GetCoreKeys - key set z( is not defined, using default bindings.zX Warning: config.py - IdleConf.GetCoreKeys - problem retrieving key binding for event z from key set r|)r^r,r]r~rçÚformer_extension_events)rråÚ keyBindingsr�rÐrÚs r rózIdleConf.GetCoreKeysPs€ð<à ˜¨ Ð6ð<ð ˜  }Ð5ð<ð ˜-¨Ð7ð <ð $ m°XÐ%>ð <ð  - ð <ð $ m _ð<ð    ð<ð ˜}˜oð<ð   ˜ð<ð  ˜xð<ð &¨  ~ð<ð    ð<ð # Y Kð<ð &¨  ð<ð   ð!<ð"  .Ð!1ð#<ð$ % y kñ%<ð&   ˜{ð'<ð( " M ?ð)<ð* (¨-¨ð+<ð, +¨]¨Oð-<ð.   ð/<ð0 ˜˜ð1<ð2 # Z Lð3<ð4 .°Ð/@ð5<ð6 &¨  {ð7<ð8   ˜ð9<ð: ˜y˜kð;<ð< 'Ð):Ð(;ð=<ð> ˜˜ð?<ð@ ˜}¨fÐ5ðA<ðB  * ðC<ðD ! >Ð"2ðE<ðF ˜˜òG<ðH ˜M˜?ðI<ðJ ˜i˜[ðK<ðL "Ð$5Ð#6ðM<ðN % ~Ð7GÐ&HðO<ðP    ðQ<ðR Ð">Ð!?ðS<ðT Ð"=Ð!>ðU<ðV ! = /ðW<ðX # ] OðY<ðZ  - ð[<ð\ " M ?ð]<ð^   ˜ð_<ð` % } oða<ðb Ð";Ð!<ðc<ðd !Ð#9Ð":ðe<ðf )Ð+@Ð*Aðg<ðh Ð 1Ð2ñi<ðj(AÐ&AØ 1Ð2Ø%2 OØ)˜lØ/Ð0Ø!. Ø -˜òw<ˆ ñ| Ø—L‘L Ñ(×4Ñ4°ZÔ@Ø—O‘O FÑ+×7Ñ7¸ ÕCò ð"ðô �g˜v zÔ2ð Ðó)�EØ"×0Ñ0°¸UÓC�GÙØ-4˜  EÒ*à d×&BÑ&BÓBò #¢J° ¸EÒ0Bð Dð ô˜g v¨z¸5ÕAð)ðÐr cóÆ—g}|dk(r|jd}n |dk(r|jd}n td«‚|jd«}|D]€}|j d|d¬«}|j d«dk(rd }d }n7|j d«}|d j«}|d j«}|sŒj|sŒm|j|||f«Œ‚|jd „¬ «|S)aºReturn list of extra help sources from a given configSet. Valid configSets are 'user' or 'default'. Return a list of tuples of the form (menu_item , path_to_help_file , option), or return the empty list. 'option' is the sequence number of the help resource. 'option' values determine the position of the menu items on the Help menu, therefore the returned list must be sorted by 'option'. r…rXr)r†Ú HelpFilesÚ;r˜éÿÿÿÿrdrròcó —|dS)Nrãr )rïs r Úz1IdleConf.GetExtraHelpSourceList..Ïs€ q¨¢tr )Úkey) r^r]rr/r*ÚfindrÜÚstripr¹Úsort) rr‡Ú helpSourcesrˆr-r'r;ÚmenuItemÚhelpPaths r ÚGetExtraHelpSourceListzIdleConf.GetExtraHelpSourceList²sê€ðˆ Ø ˜Ò ØŸ ™  VÑ,‰IØ ˜)Ò #ØŸ™¨Ñ/‰Iä"Ð#@ÓAÐ AØ×'Ñ'¨ Ó4ˆÛˆFØ—-‘-  ¨V¸S�-ÓAˆEØ�z‰z˜#‹ "Ò$Ø�Ø‘à—k‘k #Ó&�ؘq™Ÿ™Ó)�ؘq™Ÿ™Ó)�ÚšHØ×"Ñ" X¨h°vÐ$>Õ@ðð ×Ñ™^ÐÔ,ØÐr cóL—|jd«|jd«z}|S)z†Return a list of the details of all additional help sources. Tuples in the list are those of GetExtraHelpSourceList. r)r…)r)rÚallHelpSourcess r ÚGetAllExtraHelpSourcesListz#IdleConf.GetAllExtraHelpSourcesListÒs-€ð ×5Ñ5°iÓ@Ø×+Ñ+¨FÓ3ñ4ˆàÐr có—|j||dd¬«}|j||ddd¬«}|j||dd d ¬ «}|d k(ry)zLoad all configuration files.N)r]r3r^©rr s r razIdleConf.LoadCfgFilesõs:€à—?”?ˆCØ �O‰O˜CÑ × %Ñ %Ô 'Ø �L‰L˜Ñ × "Ñ "Õ $ñ#r có`—|jD]}|j|j«Œ!y)z2Write all loaded user configuration files to disk.N)r^rTr&s r ÚSaveUserCfgFileszIdleConf.SaveUserCfgFilesûs%€à—<”<ˆCØ �L‰L˜Ñ × "Ñ "Õ $ñ r )F)NNTF)TFFr4)"rr r r5rr`rir‚r<r‰r•r�rŸr¢ržÚ staticmethodr§rÁr¸rÑrÌrôrárçrÓrérørrórrr$rar(r r r rVrV‘sÉ„ñ ó  òHò"ðHIMØ,1ó&òPCò$ò 8òBòH5ò4ò$MðLñ&óð&ð)-Ø49ó'òRZò òò$ò$ò( òò"ò$>ò Ðó`òDò@ò<ò4%ó %r rVcó¢—|f|z}|tvr2 t|tj¬«tj |«yy#t$rYŒ"wxYw)Nrp)Ú_warnedrrrsrtrLÚadd)Úmsgr s r r~r~sO€Ø ˆ&�3‰,€CØ ”'Ñð Ü �#œCŸJ™JÕ 'ô � ‰ �CÕð øôò Ù ð ús�AÁ AÁ Acó>—eZdZdZd„Zd„Zed„«Zd„Zd„Z d„Z y) Ú ConfigChangesaèManage a user's proposed configuration option changes. Names used across multiple methods: page -- one of the 4 top-level dicts representing a .idlerc/config-x.cfg file. config_type -- name of a page. section -- a section within a page/file. option -- name of an option within a section. value -- value for the option. Methods add_option: Add option and value to changes. save_option: Save option and value to config parser. save_all: Save all the changes to the config parser and file. delete_section: If section exists, delete from changes, userCfg, and file. clear: Clear all changes by clearing each page. có‚—g|_tjD]%}i||<|jj||«Œ'y)z)Create a page for each configuration fileN)ÚpagesÚidleConfr\r¹)rÚ config_types r rzConfigChanges.__init__!s:€àˆŒ Ü#×0Ô0ˆKØ "ˆD�Ñ Ø �J‰J× Ñ ˜d ;Ñ/Õ 0ñ1r cóF—||}t|«}||vri||<||||<y)z0Add item/value pair for config_type and section.N)Ústr)rr3r&Úitemr;Úpages r Ú add_optionzConfigChanges.add_option(s4€à�KÑ ˆÜ�E“ ˆØ ˜$Ñ ØˆD�‰MØ#ˆˆW‰ �dÒr có"—tj|j||«rItj|j||«|k(r#tj|j ||«Stj|j |||«S)zcReturn True if the configuration value was added or changed. Helper for save_all. )r2r]r"r*r^r?r<)r3r&r6r;s r Ú save_optionzConfigChanges.save_option0s}€ô × Ñ ˜{Ñ +× 6Ñ 6°wÀÔ EÜ×"Ñ" ;Ñ/×3Ñ3°G¸TÓBÀeÒKä×'Ñ'¨ Ñ4×AÑAÀ'È4ÓPÐPä×Ñ  Ñ,×6Ñ6°wÀÀeÓLÐLr c óè—tjdj«d}|D]‘}d}||}|D]]}|dk(r$tjdjd«d}||j «D]\}}|j ||||«sŒd}ŒŒ_|sŒotj|j«d}Œ“dD]#}tj|j«Œ%|j «|S)z›Save configuration changes to the user config file. Clear self in preparation for additional changes. Return changed for testing. rXFrT)rZrY)r2r^rTrDrêr:Úclear)rÚchangedr3Úcfg_type_changedr7r&r6r;s r Úsave_allzConfigChanges.save_all=sö€ô ×Ñ˜Ñ ×%Ñ%Ô'àˆÛˆKØ$Рؘ Ñ$ˆDÛ�ؘkÒ)Ü×$Ñ$ VÑ,×;Ñ;¸KÔHØ'+Ð$Ø#'¨¡=×#6Ñ#6Ö#8‘K�D˜%Ø×'Ñ'¨ °W¸dÀEÕJØ+/Ñ(ñ$9ð  ò Ü× Ñ  Ñ-×2Ñ2Ô4Ø‘ð ó1ˆKä × Ñ ˜[Ñ )× .Ñ .Õ 0ð1ð � ‰ Œ ðˆr có†—|||vr|||=tj|}|j|«|j«y)zjDelete a section from self, userCfg, and file. Used to delete custom themes and keysets. N)r2r^rDrT)rr3r&Ú configpages r Údelete_sectionzConfigChanges.delete_section[sF€ð �d˜;Ñ'Ñ 'Ø�[Ñ! 'Ð*Ü×%Ñ% kÑ2ˆ Ø×!Ñ! 'Ô*Ø�‰Õr cóF—|jD]}|j«Œy)z–Clear all 4 pages. Called in save_all after saving to idleConf. XXX Mark window *title* when there are changes; unmark here. N)r1r<)rr7s r r<zConfigChanges.clearfs€ð —J”JˆDØ �J‰J�Lñr N) rr r r5rr8r)r:r?rBr<r r r r/r/s6„ñò$1ò$ðñ Móð Mòò< ór r/c󲇇‡‡—ddlmŠd\ŠŠˆˆˆfd„Šˆfd„}|tj«|tj«t d‰d‰d¬ «y) Nr)Úcrc32)rrcón•—t|«}‰dz Љ|jd¬«‰«Št|«y)Nròzutf-8)Úencoding)r5Úencoderr)ÚobjÚtxtÚcrcrEÚlines €€€r Úsprintz_dump..sprintus3ø€ä�#‹hˆØ �‰ ˆÙ�C—J‘J¨�JÓ0°#Ó6ˆÜ ˆc� r c ó,•—td|d«t|«D]x}||j«}‰|«‰|«|D]N}||j|«}‰|«‰|«|D]#}‰|dz||j ||«z«Œ%ŒPŒzy)NÚ z = )rrÚsortedrCr-r*)r_r rCr&r-r'rMs €r ÚdumpCfgz_dump..dumpCfg}s”ø€Ü ˆd�C˜Ôܘ#–;ˆCؘ3‘x×(Ñ(Ó*ˆHÙ �3ŒKÙ �8Ô Û#�ؘc™(×*Ñ*¨7Ó3�Ù�w”Ù�w”Û%�FÙ˜6 E™>¨C°©H¯L©L¸À&Ó,IÑIÕJñ&ñ $ñ r z lines = z, crc = rd)Úsep)ÚzlibrEr2r]r^rr)rQrKrErLrMs @@@@r Ú_dumprTqsHû€ÝØ�I€Dˆ#öô Kñ ŒH× Ñ Ô Ù ŒH× Ñ ÔÜ ˆ,˜˜j¨#°2Ö6r Ú__main__)rXzidlelib.idle_test.test_configrãF)Ú verbosityÚexit)r5Ú configparserrrMrsÚ tkinter.fontrrgÚ Exceptionrrrrr7rVr2r9r+r~Údictr/rTrÚunittestrXr r r Úr]s©ðñõ6&Û Û åÛä(˜ Ô(Ü'�yÔ'Ü#�9Ô#ô&!�\ô&!ôP@%˜ô@%÷Dm %ñm %ñ` ‹:€á ‹%€òô_�Dô_òF7ð< ˆzÒÝÙÐ (°A¸EÕBá …Gð r