Return a mapping of representing this Resource and its data in a form that is fully serializable (to JSON, YAML, pickle, etc.) and can be used to reconstruct a Resource.
(self)
| 1627 | return res |
| 1628 | |
| 1629 | def serialize(self): |
| 1630 | """ |
| 1631 | Return a mapping of representing this Resource and its data in a form |
| 1632 | that is fully serializable (to JSON, YAML, pickle, etc.) and can be used |
| 1633 | to reconstruct a Resource. |
| 1634 | """ |
| 1635 | # we save all fields, not just the one in .to_dict() |
| 1636 | serializable = attr.asdict(self) |
| 1637 | serializable["name"] = self.name |
| 1638 | if self.location: |
| 1639 | serializable["location"] = self.location |
| 1640 | if self.cache_location: |
| 1641 | serializable["cache_location"] = self.cache_location |
| 1642 | return serializable |
| 1643 | |
| 1644 | |
| 1645 | def clean_path(path): |
no outgoing calls
no test coverage detected