Set an option.
(self, section, option, value=None)
| 938 | or option in self._defaults) |
| 939 | |
| 940 | def set(self, section, option, value=None): |
| 941 | """Set an option.""" |
| 942 | if value: |
| 943 | value = self._interpolation.before_set(self, section, option, |
| 944 | value) |
| 945 | if not section or section == self.default_section: |
| 946 | sectdict = self._defaults |
| 947 | else: |
| 948 | try: |
| 949 | sectdict = self._sections[section] |
| 950 | except KeyError: |
| 951 | raise NoSectionError(section) from None |
| 952 | sectdict[self.optionxform(option)] = value |
| 953 | |
| 954 | def write(self, fp, space_around_delimiters=True): |
| 955 | """Write an .ini-format representation of the configuration state. |
no test coverage detected