iiif-prezi / iiif-prezi3

IIIF Presentation API 3 Python Library
https://iiif-prezi.github.io/iiif-prezi3/
Apache License 2.0
28 stars 14 forks source link

Update existing helpers for new Canvas types #177

Open digitaldogsbody opened 1 year ago

digitaldogsbody commented 1 year ago

Something that occurred to me when doing the work in #176 - we now have PlaceholderCanvas and AccompanyingCanvas and they can make use of all(?) the helpers that are applicable to Canvas objects and so we should look at updating existing helpers to monkeypatch them in here when appropriate.

Additionally, we might consider extending make_canvas_from_iiif to be able to create either of the other types.

  1. By passing object type in the constructor - slight clunky, breaking change
  2. By copying the existing code into a new helper and changing the object type created - less work, but violates DRY
  3. By wrapping the existing function and type-coercing - unsure if this would work, but it's my favoured approach if it does