MCPcopy Index your code
hub / github.com/python/cpython / save_all

Method save_all

Lib/idlelib/config.py:829–857  ·  view source on GitHub ↗

Save configuration changes to the user config file. Clear self in preparation for additional changes. Return changed for testing.

(self)

Source from the content-addressed store, hash-verified

827 return idleConf.userCfg[config_type].SetOption(section, item, value)
828
829 def save_all(self):
830 """Save configuration changes to the user config file.
831
832 Clear self in preparation for additional changes.
833 Return changed for testing.
834 """
835 idleConf.userCfg['main'].Save()
836
837 changed = False
838 for config_type in self:
839 cfg_type_changed = False
840 page = self[config_type]
841 for section in page:
842 if section == 'HelpFiles': # Remove it for replacement.
843 idleConf.userCfg['main'].remove_section('HelpFiles')
844 cfg_type_changed = True
845 for item, value in page[section].items():
846 if self.save_option(config_type, section, item, value):
847 cfg_type_changed = True
848 if cfg_type_changed:
849 idleConf.userCfg[config_type].Save()
850 changed = True
851 for config_type in ['keys', 'highlight']:
852 # Save these even if unchanged!
853 idleConf.userCfg[config_type].Save()
854 self.clear()
855 # ConfigDialog caller must add the following call
856 # self.save_all_changed_extensions() # Uses a different mechanism.
857 return changed
858
859 def delete_section(self, config_type, section):
860 """Delete a section from self, userCfg, and file.

Callers 5

applyMethod · 0.80
delete_customMethod · 0.80
delete_custom_keysMethod · 0.80
test_save_addedMethod · 0.80
test_save_helpMethod · 0.80

Calls 5

save_optionMethod · 0.95
clearMethod · 0.95
SaveMethod · 0.80
remove_sectionMethod · 0.80
itemsMethod · 0.45

Tested by 2

test_save_addedMethod · 0.64
test_save_helpMethod · 0.64