| 181 | |
| 182 | |
| 183 | def _parse_nested(config_value): |
| 184 | # Given a value like this: |
| 185 | # \n |
| 186 | # foo = bar |
| 187 | # bar = baz |
| 188 | # We need to parse this into |
| 189 | # {'foo': 'bar', 'bar': 'baz} |
| 190 | parsed = {} |
| 191 | for line in config_value.splitlines(): |
| 192 | line = line.strip() |
| 193 | if not line: |
| 194 | continue |
| 195 | # The caller will catch ValueError |
| 196 | # and raise an appropriate error |
| 197 | # if this fails. |
| 198 | key, value = line.split('=', 1) |
| 199 | parsed[key.strip()] = value.strip() |
| 200 | return parsed |
| 201 | |
| 202 | |
| 203 | def _parse_section(key, values): |