3 § fÞ—ã@sôdZddlmZddlZddlZddlmZddlZGdd„deƒZ Gdd„deƒZ Gd d „d eƒZ Gd d „d eƒZ Gd d„deƒZ Gdd„de ƒZGdd„dƒZeƒZeƒZdd„ZGdd„deƒZdd„ZedkrðddlmZedddd�dS)aEidlelib.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 'extenstons', 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 useable 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@s eZdZdS)ÚInvalidConfigTypeN)Ú__name__Ú __module__Ú __qualname__©rrú3/opt/alt/python36/lib64/python3.6/idlelib/config.pyr#src@s eZdZdS)ÚInvalidConfigSetN)rrrrrrr r $sr c@s eZdZdS)Ú InvalidFgBgN)rrrrrrr r %sr c@s eZdZdS)Ú InvalidThemeN)rrrrrrr r &sr c@s4eZdZdZd dd„Zd dd„Zdd „Zd d „ZdS)ÚIdleConfParserzI A ConfigParser specialised for idle configuration file handling NcCs||_tj||dd�dS)zK cfgFile - string, fully specified configuration file name F)ZdefaultsÚstrictN)ÚfilerÚ__init__)ÚselfÚcfgFileZ cfgDefaultsrrr r,szIdleConfParser.__init__FcCsL|j||ƒs|S|dkr$|j||ƒS|dkr8|j||ƒS|j|||d�SdS)z Get an option value for given section/option or return default. If type is specified, return as type. ÚboolÚint)ÚrawN)Ú has_optionZ getbooleanZgetintÚget)rÚsectionÚoptionÚtypeÚdefaultrrrr ÚGet3s   zIdleConfParser.GetcCs|j|ƒr|j|ƒSgSdS)z4Return a list of options for given section, else [].N)Ú has_sectionÚoptions)rrrrr Ú GetOptionListDs  zIdleConfParser.GetOptionListcCs|jr|j|jƒdS)z&Load the configuration file from disk.N)rÚread)rrrr ÚLoadKszIdleConfParser.Load)N)NNF)rrrÚ__doc__rrrr!rrrr r (s   r c@sHeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dS)ÚIdleUserConfParserzG IdleConfigParser specialised for user configuration handling. cCs^|j||ƒr4|j||ƒ|kr dS|j|||ƒdSn&|j|ƒsH|j|ƒ|j|||ƒdSdS)z‘Return True if option is added or changed to value, else False. Add section if required. False means option already had value. FTN)rrÚsetrÚ add_section)rrrÚvaluerrr Ú SetOptionUs   zIdleUserConfParser.SetOptioncCs|j|ƒr|j||ƒSdS)z‹Return True if option is removed from section, else False. False if either section does not exist or did not have option. F)rZ remove_option)rrrrrr Ú RemoveOptionfs  zIdleUserConfParser.RemoveOptioncCs|j|ƒs|j|ƒdS)z!If section doesn't exist, add it.N)rr%)rrrrr Ú AddSectionos zIdleUserConfParser.AddSectioncCs*x$|jƒD]}|j|ƒs |j|ƒq WdS)z)Remove any sections that have no options.N)ÚsectionsrÚremove_section)rrrrr ÚRemoveEmptySectionsts z&IdleUserConfParser.RemoveEmptySectionscCs|jƒ|jƒ S)z9Return True if no sections after removing empty sections.)r,r*)rrrr ÚIsEmptyzszIdleUserConfParser.IsEmptycCstjj|jƒrtj|jƒdS)z9Remove user config file self.file from disk if it exists.N)ÚosÚpathÚexistsrÚremove)rrrr Ú RemoveFileszIdleUserConfParser.RemoveFilecCsr|j}|rn|jƒsfyt|dƒ}Wn(tk rHtj|ƒt|dƒ}YnX|�|j|ƒWdQRXn|jƒdS)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. ÚwN)rr-ÚopenÚOSErrorr.ÚunlinkÚwriter2)rZfnamerrrr ÚSave„s zIdleUserConfParser.SaveN) rrrr"r'r(r)r,r-r2r8rrrr r#Ps r#c@seZdZdZdEdd„Zdd„Zdd„ZdFd d „Zd d„Zdd„Z dGdd„Z dd„Z dd„Z dd„Z dd„Zedd„ƒZdHdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2d3d4d5d6d7d8hZdId9d:„Zd;d<„Zd=d>„Zd?d@„ZdAdB„Z dCdD„Z!d S)JÚ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 FcCs0d|_i|_i|_i|_|s,|jƒ|jƒdS)NÚmainÚ highlightÚkeysÚ extensions)r:r;r<r=)Ú config_typesÚ defaultCfgÚuserCfgÚcfgÚCreateConfigHandlersÚ LoadCfgFiles)rZ_utestrrr r£szIdleConf.__init__cCsºtdkrtjjtƒ}ntjjtjdƒ}|jƒ|_}i}i}xB|j D]8}tjj |d|dƒ||<tjj |d|dƒ||<qFWx2|j D](}t ||ƒ|j |<t ||ƒ|j|<qŠWdS)z5Populate default and user config parser dictionaries.Ú__main__rzconfig-z.defz.cfgN)rr.r/ÚdirnameÚ__file__ÚabspathÚsysÚ GetUserCfgDirZuserdirr>Újoinr r?r#r@)rZidleDirÚuserDirZ defCfgFilesZ usrCfgFilesZcfgTyperrr rB­s  zIdleConf.CreateConfigHandlerscCsÒd}tjjdƒ}|dkr\tjj|ƒs\d|d}yt|tjd�Wntk rVYnXd}|dkrltjƒ}tjj ||ƒ}tjj|ƒsÎytj |ƒWn8tk rÌd|d}t j sÄt|tjd�t ‚YnX|S)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! )r.r/Ú expanduserr0ÚprintrHÚstderrr5ÚgetcwdrJÚmkdirÚidlelibZtestingÚ SystemExit)rZcfgDirrKÚwarnrrr rIÂs,      zIdleConf.GetUserCfgDirNTc CsÜy.|j|j||ƒr,|j|j||||d�SWnDtk rrd||||j|j|||d�f}t||||ƒYnXy.|j|j||ƒr |j|j||||d�SWntk r¶YnX|rØd|||f}t||||ƒ|S)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. )rrzn Warning: config.py - IdleConf.GetOption - invalid %r value for configuration option %r from section %r: %r)rz† Warning: config.py - IdleConf.GetOption - problem retrieving configuration option %r from section %r. returning default value: %r)r@rrÚ ValueErrorÚ_warnr?) rÚ configTyperrrrÚwarn_on_defaultrÚwarningrrr Ú GetOptionâs(   zIdleConf.GetOptioncCs|j|j|||ƒdS)z0Set section option to value in user config file.N)r@r')rrWrrr&rrr r' szIdleConf.SetOptioncCsJ||jkrtdƒ‚|dkr&|j|}n|dkr:|j|}ntdƒ‚|jƒS)z§Return sections for configSet configType configuration. configSet must be either 'user' or 'default' configType must be in self.config_types. zInvalid configType specifiedÚuserrzInvalid configSet specified)r>rr@r?r r*)rÚ configSetrWÚ cfgParserrrr ÚGetSectionLists   zIdleConf.GetSectionListcCs’|jdj|ƒr|jd|ƒ}n |jd|ƒ}||d}|dkrH|d}n ||d}||dœ}|sf|S|d krv|d S|d kr†|d Std ƒ‚dS)aReturn individual theme element highlight color(s). fgBg - string ('fg' or 'bg') or None. If None, return a dictionary containing fg and bg colors with keys 'foreground' and 'background'. Otherwise, only return fg or bg color, as specified. Colors are intended to be appropriate for passing to Tkinter in, e.g., a tag_config call). r;rr[z -foregroundZcursorznormal-backgroundz -background)Ú foregroundÚ backgroundZfgr_Zbgr`zInvalid fgBg specifiedN)r?rÚ GetThemeDictr )rÚthemeÚelementZfgBgZ themeDictZforeZbackr;rrr Ú GetHighlights      zIdleConf.GetHighlightcCsÆ|dkr|jd}n|dkr(|jd}ntdƒ‚ddddddddddddddddddddddddddddddœ}xP|D]H}|j||ƒs¦d ||||f}t|d||ƒ|j||||d �||<qvW|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[r;rzInvalid theme type specifiedz#000000z#ffffffZgray)znormal-foregroundznormal-backgroundzkeyword-foregroundzkeyword-backgroundzbuiltin-foregroundzbuiltin-backgroundzcomment-foregroundzcomment-backgroundzstring-foregroundzstring-backgroundzdefinition-foregroundzdefinition-backgroundzhilite-foregroundzhilite-backgroundzbreak-foregroundzbreak-backgroundzhit-foregroundzhit-backgroundzerror-foregroundzerror-backgroundzcursor-foregroundzstdout-foregroundzstdout-backgroundzstderr-foregroundzstderr-backgroundzconsole-foregroundzconsole-backgroundzcontext-foregroundzcontext-backgroundz{ Warning: config.IdleConf.GetThemeDict - problem retrieving theme element %r from theme %r. returning default color: %r)r)r@r?r rrVr)rrZ themeNamer]rbrcrYrrr ra;sT    zIdleConf.GetThemeDictcCs |jdƒS)z9Return the name of the currently active text color theme.ÚTheme)Úcurrent_colors_and_keys)rrrr Ú CurrentTheme{szIdleConf.CurrentThemecCs |jdƒS)z0Return the name of the currently active key set.ZKeys)rf)rrrr Ú CurrentKeysszIdleConf.CurrentKeyscCsŽ|dkr dnd}|jd|dddd�}d }|r>|jd|d d d �}|sT|jd|d d d �}|rz|rb|jn|j}||j|ƒrz|S|dkr†d 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. rer;r<r:rrT)rrÚZname2)rÚnamez IDLE Classic)rZr?r@rÚ default_keys)rrZcfgnamerrjÚsourcerrr rfƒs  z IdleConf.current_colors_and_keyscCs,tjdd…dkrdStjdkr$dSdSdS)NéÚwinzIDLE Classic WindowsÚdarwinzIDLE Classic OSXzIDLE Modern Unix)rHÚplatformrrrr rk©s  zIdleConf.default_keysc CsÔ|j|jddƒƒ}|j|jddƒƒ}x|D]}||kr*|j|ƒq*WxdD]}|j|ƒqJW|rÌg}xb|D]Z}|jd|dd d d �rj|sŠ|rº|r”d }nd }|jd||d d dd�rÄ|j|ƒqj|j|ƒqjW|S|SdS)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. rr=r[Ú AutoCompleteÚ CodeContextÚFormatParagraphÚ ParenMatchÚenableTr)rrZ enable_editorZ enable_shellF)rrrXN)rqrrrsrt)ÚRemoveKeyBindNamesr^Úappendr1rZ) rÚ active_onlyZ editor_onlyZ shell_onlyZextnsZ userExtnsÚextnÚ activeExtnsrrrr Ú GetExtensions²s4     zIdleConf.GetExtensionscCsdd„|DƒS)z:Return extnNameList with keybinding section names removed.cSsg|]}|jdƒs|‘qS)Ú _bindingsÚ _cfgBindings)r|r})Úendswith)Ú.0Únrrr ú Ýsz/IdleConf.RemoveKeyBindNames..r)rZ extnNameListrrr rvÛszIdleConf.RemoveKeyBindNamescCsJd}d|d}x4|jdd�D]$}x|j|ƒD]}||kr.|}q.WqW|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 '<< >>' Nz<>r)rx)r{ÚGetExtensionKeys)rÚ virtualEventZextNameZvEventryÚeventrrr ÚGetExtnNameForEventßs  zIdleConf.GetExtnNameForEventc Csb|d}|jƒ}i}|jdj|ƒr^|jdj|ƒ}x(|D] }d|d}||}|||<q:W|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=z<>)ÚGetCurrentKeySetr?rr) rÚ extensionNameÚkeysNameZ activeKeysÚextKeysÚ eventNamesÚ eventNamer„Úbindingrrr r‚ís   zIdleConf.GetExtensionKeyscCsh|d}i}|jdj|ƒrd|jdj|ƒ}x6|D].}|jd||dd�jƒ}d|d}|||<q2W|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=ri)rz<>)r?rrrZÚsplit)rr‡rˆr‰rŠr‹rŒr„rrr Z__GetRawExtensionKeysÿs   zIdleConf.__GetRawExtensionKeyscCsn|d}|j|ƒ}|jdj|ƒrj|jdj|ƒ}x6|D].}|jd||dd�jƒ}d|d}|||<q8W|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=ri)rz<>)r‚r?rrrZr�)rr‡Z bindsNameZextBindsrŠr‹rŒr„rrr ÚGetExtensionBindingss    zIdleConf.GetExtensionBindingscCs(|dd…}|jd||ddd�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 '<>'. ér<riF)rrXéþÿÿÿ)rZr�)rÚ keySetNameZeventStrr‹rŒrrr Ú GetKeyBinding%s   zIdleConf.GetKeyBindingcCsP|j|jƒƒ}tjdkrLx2|jƒD]&\}}dd„|Dƒ}||kr"|||<q"W|S)z/Return CurrentKeys with 'darwin' modifications.rocSsg|]}|jddƒ‘qS)z.)Ú GetKeySetrhrHrpÚitems)rÚresultÚkÚvZv2rrr r†0s  zIdleConf.GetCurrentKeySetcCsh|j|ƒ}|jdd�}xL|D]D}|j|ƒ}|rx0|D](}|||jƒkrPd||<||||<q4WqW|S)zÈReturn event-key dict for keySetName core plus active extensions. If a binding defined in an extension is already in use, the extension binding is disabled by being set to '' é)rxri)Ú GetCoreKeysr{Ú_IdleConf__GetRawExtensionKeysÚvalues)rr‘ZkeySetrzryr‰r„rrr r•As     zIdleConf.GetKeySetcCsd|d|jƒkS)zÉReturn True if the virtual event is one of the core idle key events. virtualEvent - string, name of the virtual event to test for, without the enclosing '<< >>' z<>)r›)rrƒrrr Ú IsCoreBindingSszIdleConf.IsCoreBindingz<>z<>z<>z<>z<>z<>z<>z<>c:Cs”ddgddgddgddgd gd gd gdgd gd gdgdgdgdgdgdgdgdgdgdgdgdgdgdgdgdgdgdgdgd gd!d"gd#gd$gd%gd&gd'gd(gd)d*gd+gd,gd-gd.gd/gd0gd1gd2gd3gd4gd5gd6gd7gd8gd9gd:gd;gdœ9}|�r�|jd?j|ƒ�p|jd?j|ƒ�s8d@|f}t|d?|ƒnXxV|D]N}|j||ƒ}|�r^|||<n,||jk�r>dA||||f}t|d?||ƒ�q>W|S)Baš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 zz z zz zz zzzz zzz z z z z zz zz zzz z zzz z z zzz zz zzz z z z z z zzzzzzz zz z )9z<>z<>z <>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z <>z <>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>z<>r<za Warning: config.py - IdleConf.GetCoreKeys - key set %r is not defined, using default bindings.z‰ Warning: config.py - IdleConf.GetCoreKeys - problem retrieving key binding for event %r from key set %r. returning default value: %r)r@rr?rVr’Úformer_extension_events)rr‘Z keyBindingsrYr„rŒrrr r›cs�      zIdleConf.GetCoreKeysc CsÂg}|dkr|jd}n|dkr,|jd}ntdƒ‚|jdƒ}xn|D]f}|jd|dd�}|jdƒdkrpd }d }n"|jdƒ}|d jƒ}|djƒ}|rD|rD|j|||fƒqDW|j d d „d �|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[r:rzInvalid configSet specifiedÚ HelpFilesú;)rršrircSs|dS)Nr�r)r”rrr Úßsz1IdleConf.GetExtraHelpSourceList..)Úkeyéÿÿÿÿ) r@r?r rrÚfindr�ÚstriprwÚsort) rr\Z helpSourcesr]rrr&ZmenuItemZhelpPathrrr ÚGetExtraHelpSourceListÂs&        zIdleConf.GetExtraHelpSourceListcCs|jdƒ|jdƒ}|S)z†Return a list of the details of all additional help sources. Tuples in the list are those of GetExtraHelpSourceList. rr[)r¨)rZallHelpSourcesrrr ÚGetAllExtraHelpSourcesListâs z#IdleConf.GetAllExtraHelpSourcesListc Cs”|j||ddd�}|j||dddd�}|j||dd d d �}|d kr‚td d |d�}tj|ƒ}|d}|d}|d krvd}|ddk}|||rŽdndfS)a‡Retrieve a font from configuration (font, font-size, font-bold) Intercept the special value 'TkFixedFont' and substitute the actual font, factoring in some tweaks if needed for appearance sakes. The 'root' parameter can normally be any valid Tkinter widget. Return a tuple (family, size, weight) suitable for passing to tkinter.Font ZfontZcourier)rz font-sizerZ10)rrz font-boldrr)rrZ TkFixedFontT)rjr0ÚrootÚfamilyÚsizeé ZweightÚboldZnormal)rZrZactual) rrªrWrr«r¬r®ÚfZ actualFontrrr ÚGetFontës     zIdleConf.GetFontcCs0x*|jD] }|j|jƒ|j|jƒqWdS)zLoad all configuration files.N)r?r!r@)rr£rrr rCs zIdleConf.LoadCfgFilescCs"x|jD]}|j|jƒqWdS)z2Write all loaded user configuration files to disk.N)r@r8)rr£rrr ÚSaveUserCfgFiles s zIdleConf.SaveUserCfgFiles)F)NNTF)N)TFF)N)"rrrr"rrBrIrZr'r^rdrargrhrfÚ staticmethodrkr{rvr…r‚rœrŽr’r†r•ržrŸr›r¨r©r°rCr±rrrr r9˜sD    ' @&  (    _  r9c GsH|f|}|tkrDyt|tjd�Wntk r8YnXtj|ƒdS)N)r)Ú_warnedrNrHrOr5Úadd)Úmsgr£rrr rVs rVc@sDeZdZdZdd„Zdd„Zedd„ƒZdd „Zd d „Z d d „Z dS)Ú 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. cCs2g|_x&tjD]}i||<|jj||ƒqWdS)z)Create a page for each configuration fileN)ÚpagesÚidleConfr>rw)rÚ config_typerrr r1s zConfigChanges.__init__cCs0||}t|ƒ}||kr i||<||||<dS)z0Add item/value pair for config_type and section.N)Ústr)rr¹rÚitemr&Úpagerrr Ú add_option8s zConfigChanges.add_optioncCsNtj|j||ƒr:tj|j||ƒ|kr:tj|j||ƒStj|j|||ƒS)zcReturn True if the configuration value was added or changed. Helper for save_all. )r¸r?rrr@r(r')r¹rr»r&rrr Ú save_option@szConfigChanges.save_optioncCsÂtjdjƒd}x†|D]~}d}||}xV|D]N}|dkrNtjdjdƒd}x,||jƒD]\}}|j||||ƒr\d}q\Wq.W|rtj|jƒd}qWxdD]}tj|jƒq W|jƒ|S)z›Save configuration changes to the user config file. Clear self in preparation for additional changes. Return changed for testing. r:Fr Tr<r;)r<r;)r¸r@r8r+r–r¾Úclear)rZchangedr¹Zcfg_type_changedr¼rr»r&rrr Úsave_allMs&    zConfigChanges.save_allcCs6|||kr|||=tj|}|j|ƒ|jƒdS)zjDelete a section from self, userCfg, and file. Used to delete custom themes and keysets. N)r¸r@r+r8)rr¹rZ configpagerrr Údelete_sectionks     zConfigChanges.delete_sectioncCsx|jD] }|jƒqWdS)z–Clear all 4 pages. Called in save_all after saving to idleConf. XXX Mark window *title* when there are changes; unmark here. N)r·r¿)rr¼rrr r¿vs zConfigChanges.clearN) rrrr"rr½r²r¾rÀrÁr¿rrrr r¶s  r¶csVddlm‰d \}}‡fdd„‰‡fdd„}|tjƒ|tjƒtd|d|d d �dS) Nr)Úcrc32cs.t|ƒ}td7aˆ|jdd�tƒat|ƒdS)Nršzutf-8)Úencoding)rºÚlineÚencodeÚcrcrN)ÚobjZtxt)rÂrr Úsprint…sz_dump..sprintcs˜td|dƒx†t|jƒƒD]v}||jƒ}ˆ|ƒˆ|ƒxT|D]L}||j|ƒ}ˆ|ƒˆ|ƒx(|D] }ˆ|d||j||ƒƒqhWq@WqWdS)NÚ z = )rNÚsortedr<r*rr)rAr£r*rrr)rÈrr ÚdumpCfg�s    z_dump..dumpCfgz lines = z, crc = ri)Úsep)rr)ÚzlibrÂr¸r?r@rN)rÄrÆrËr)rÂrÈr Ú_dump�s    rÎrD)r:zidlelib.idle_test.test_configr�F)Ú verbosityÚexit)r"Z configparserrr.rHZ tkinter.fontrrRÚ Exceptionrr r r r r#r9r¸r$r³rVÚdictr¶rÎrZunittestr:rrrr Ús0  (H} c