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

Method SetOption

Lib/idlelib/config.py:84–99  ·  view source on GitHub ↗

Return True if option is added or changed to value, else False. Add section if required. False means option already had value.

(self, section, option, value)

Source from the content-addressed store, hash-verified

82 """
83
84 def SetOption(self, section, option, value):
85 """Return True if option is added or changed to value, else False.
86
87 Add section if required. False means option already had value.
88 """
89 if self.has_option(section, option):
90 if self.get(section, option) == value:
91 return False
92 else:
93 self.set(section, option, value)
94 return True
95 else:
96 if not self.has_section(section):
97 self.add_section(section)
98 self.set(section, option, value)
99 return True
100
101 def RemoveOption(self, section, option):
102 """Return True if option is removed from section, else False.

Callers

nothing calls this directly

Calls 5

has_sectionMethod · 0.80
has_optionMethod · 0.45
getMethod · 0.45
setMethod · 0.45
add_sectionMethod · 0.45

Tested by

no test coverage detected