(self, string, defaults=None)
| 1492 | config_class = configparser.ConfigParser |
| 1493 | |
| 1494 | def fromstring(self, string, defaults=None): |
| 1495 | cf = self.newconfig(defaults) |
| 1496 | cf.read_string(string) |
| 1497 | cf_copy = self.newconfig() |
| 1498 | cf_copy.read_dict(cf) |
| 1499 | # we have to clean up option duplicates that appeared because of |
| 1500 | # the magic DEFAULTSECT behaviour. |
| 1501 | for section in cf_copy.values(): |
| 1502 | if section.name == self.default_section: |
| 1503 | continue |
| 1504 | for default, value in cf[self.default_section].items(): |
| 1505 | if section[default] == value: |
| 1506 | del section[default] |
| 1507 | return cf_copy |
| 1508 | |
| 1509 | |
| 1510 | class FakeFile: |
no test coverage detected