Add to_model() method to from_disk.{Content,Directory}, to convert to canonical model objects.
They will be used by loaders, so they can deal only with model objects, instead of having to do the same conversion themselves. This removes the `data` and `save_path` arguments of `from_file` and `from_disk`, as data loading is always deferred from now on. To access it, users are now expected to either open the data files themselves, or us `.to_model().with_data()`.
Showing
- swh/model/from_disk.py 47 additions, 27 deletionsswh/model/from_disk.py
- swh/model/model.py 24 additions, 3 deletionsswh/model/model.py
- swh/model/tests/test_from_disk.py 146 additions, 36 deletionsswh/model/tests/test_from_disk.py
- swh/model/tests/test_model.py 17 additions, 0 deletionsswh/model/tests/test_model.py
Loading
Please register or sign in to comment