| 606 | |
| 607 | |
| 608 | class SafeConfigParserUnicode(ConfigParser): |
| 609 | def write(self, fp): |
| 610 | """Write an .ini-format representation of the configuration state.""" |
| 611 | if self._defaults: |
| 612 | fp.write("[%s]\n" % DEFAULTSECT) |
| 613 | for (key, value) in list(self._defaults.items()): |
| 614 | fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t'))) |
| 615 | fp.write("\n") |
| 616 | for section in self._sections: |
| 617 | fp.write("[%s]\n" % section) |
| 618 | for (key, value) in list(self._sections[section].items()): |
| 619 | if key == "__name__": |
| 620 | continue |
| 621 | if (value is not None) or (self._optcre == self.OPTCRE): |
| 622 | key = " = ".join((key, str(value).replace('\n', '\n\t'))) |
| 623 | fp.write("%s\n" % key) |
| 624 | fp.write("\n") |
no outgoing calls
no test coverage detected