(cls, filename)
| 22 | |
| 23 | @classmethod |
| 24 | def load(cls, filename): |
| 25 | h = _lib.cactus_graph_load(str(filename).encode()) |
| 26 | if not h: |
| 27 | raise RuntimeError("cactus_graph_load failed") |
| 28 | obj = cls.__new__(cls) |
| 29 | obj.h = h |
| 30 | return obj |
| 31 | |
| 32 | def __del__(self): |
| 33 | h = getattr(self, "h", None) |