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

Method save_option

Lib/idlelib/config.py:817–827  ·  view source on GitHub ↗

Return True if the configuration value was added or changed. Helper for save_all.

(config_type, section, item, value)

Source from the content-addressed store, hash-verified

815
816 @staticmethod
817 def save_option(config_type, section, item, value):
818 """Return True if the configuration value was added or changed.
819
820 Helper for save_all.
821 """
822 if idleConf.defaultCfg[config_type].has_option(section, item):
823 if idleConf.defaultCfg[config_type].Get(section, item) == value:
824 # The setting equals a default setting, remove it from user cfg.
825 return idleConf.userCfg[config_type].RemoveOption(section, item)
826 # If we got here, set the option.
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.

Callers 2

save_allMethod · 0.95
test_save_helpMethod · 0.80

Calls 4

GetMethod · 0.80
RemoveOptionMethod · 0.80
has_optionMethod · 0.45
SetOptionMethod · 0.45

Tested by 1

test_save_helpMethod · 0.64