Write a single section to the specified 'fp'.
(self, fp, section_name, section_items, delimiter, unnamed=False)
| 977 | self._sections[section].items(), d) |
| 978 | |
| 979 | def _write_section(self, fp, section_name, section_items, delimiter, unnamed=False): |
| 980 | """Write a single section to the specified 'fp'.""" |
| 981 | if not unnamed: |
| 982 | fp.write("[{}]\n".format(section_name)) |
| 983 | for key, value in section_items: |
| 984 | self._validate_key_contents(key) |
| 985 | value = self._interpolation.before_write(self, section_name, key, |
| 986 | value) |
| 987 | if value is not None or not self._allow_no_value: |
| 988 | value = delimiter + str(value).replace('\n', '\n\t') |
| 989 | else: |
| 990 | value = "" |
| 991 | fp.write("{}{}\n".format(key, value)) |
| 992 | fp.write("\n") |
| 993 | |
| 994 | def remove_option(self, section, option): |
| 995 | """Remove an option.""" |
no test coverage detected