Method
from_string
(cls, string: str, to_dict: bool = False)
Source from the content-addressed store, hash-verified
| 305 | |
| 306 | @classmethod |
| 307 | def from_string(cls, string: str, to_dict: bool = False) -> Definition: |
| 308 | lines = string.split('\n') |
| 309 | data = [cls.from_txt('\n'.join(group)) for group in reshape(lines, 6)] |
| 310 | if to_dict: |
| 311 | return cls.to_dict(data) |
| 312 | return data |
| 313 | |
| 314 | @classmethod |
| 315 | def to_dict(cls, data: list[Definition]) -> dict[str, Definition]: |
Callers
nothing calls this directly
Tested by
no test coverage detected