(text, filter_=None)
| 123 | |
| 124 | @staticmethod |
| 125 | def read(text, filter_=None): |
| 126 | lines = filter(filter_, map(str.strip, text.splitlines())) |
| 127 | name = None |
| 128 | for value in lines: |
| 129 | section_match = value.startswith('[') and value.endswith(']') |
| 130 | if section_match: |
| 131 | name = value.strip('[]') |
| 132 | continue |
| 133 | yield Pair(name, value) |
| 134 | |
| 135 | @staticmethod |
| 136 | def valid(line: str): |
no test coverage detected