Add an open method to each source module. #550
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This also adds a canRead method to each source module and an open method to the primary module.
Before, to open a file with a specific file source, you needed to do something like
large_image_source_tiff.TiffFileTileSource(path)
, where the name of the tile source's class had to be used. Now, you can dolarge_image_source_tiff.open(path)
, which maps to the same thing. The old way still works. Similarly,canRead
required something likelarge_image_source_tiff.TiffFileTileSource.canRead(path)
and nowlarge_image_source_tiff.canRead(path)
works as well.open
is now also a synonym forgetTileSource
, so generically,large_image.getTileSource(path)
can be written aslarge_image.open(path)
.There is no requirement that tile source modules expose the
open
andcanRead
methods directly; it is more a convenience for developers.