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

Method set_extension_value

Lib/idlelib/configdialog.py:2047–2062  ·  view source on GitHub ↗

Return True if the configuration was added or changed. If the value is the same as the default, then remove it from user config file.

(self, section, opt)

Source from the content-addressed store, hash-verified

2045 return
2046
2047 def set_extension_value(self, section, opt):
2048 """Return True if the configuration was added or changed.
2049
2050 If the value is the same as the default, then remove it
2051 from user config file.
2052 """
2053 name = opt['name']
2054 default = opt['default']
2055 value = opt['var'].get().strip() or default
2056 opt['var'].set(value)
2057 # if self.defaultCfg.has_section(section):
2058 # Currently, always true; if not, indent to return.
2059 if (value == default):
2060 return self.ext_userCfg.RemoveOption(section, name)
2061 # Set the option.
2062 return self.ext_userCfg.SetOption(section, name, value)
2063
2064 def save_all_changed_extensions(self):
2065 """Save configuration changes to the user config file.

Callers 1

Calls 5

RemoveOptionMethod · 0.80
stripMethod · 0.45
getMethod · 0.45
setMethod · 0.45
SetOptionMethod · 0.45

Tested by

no test coverage detected