Coverage for lode / viewer / __init__.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-11-22 15:54 +0000

1"""Viewer layer: renders the model as view data for the HTML templates.""" 

2 

3from .base_viewer import BaseViewer 

4 

5 

6def get_viewer(artefact): 

7 """Return the viewer of the artefact's profile. 

8 

9 An artefact without a profile (one built by hand with Artefact.from_parts) gets the 

10 generic BaseViewer. 

11 """ 

12 profile = artefact.profile 

13 return profile.make_viewer(artefact) if profile else BaseViewer(artefact)