Conditions | 3 |
Total Lines | 9 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import re |
||
25 | @classmethod |
||
26 | def from_path(cls, path: Path): |
||
27 | dct = {} |
||
28 | for line in path.read_text(encoding="utf8").splitlines(): |
||
29 | if not line.startswith("#"): |
||
30 | key, value = line.split("--->") |
||
31 | key, value = key.strip(), value.strip() |
||
32 | dct[re.compile(key)] = value |
||
33 | return RegexMap(dct) |
||
34 | |||
42 |