MCPcopy Create free account
hub / github.com/Syncplay/syncplay / SafeConfigParserUnicode

Class SafeConfigParserUnicode

syncplay/ui/ConfigurationGetter.py:608–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606
607
608class 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")

Callers 2

_parseConfigFileMethod · 0.85
_saveConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected