render¶
Render the thirty Home-screen candidates to PNGs.
Standalone:
python spacr/resources/home/versions/_generators/render.py
python .../render.py --only 7 --only 23 # just those two
python .../render.py --themes dark # one theme
python .../render.py --check # audit existing PNGs only
Writes, under spacr/resources/home/versions/:
vNN_<slug>/dark.png vNN_<slug>/light.png [vNN_<slug>/space.png]
_sheet.png all thirty, numbered, dark
VARIANTS.md one paragraph per variant
Every render is deterministic: offscreen Qt, a throwaway QSettings
path, bundled fonts, and fixed mock content (see common).
Attributes¶
Functions¶
|
Inspect a laid-out page for the defects that invalidate a render. |
|
Compose all thirty renders into one numbered grid. Returns the path. |
|
The cached audit, or an empty dict when there is none. |
|
|
|
|
|
Render every (variant, theme) pair. Returns the audit per pair. |
|
Build one variant in one theme, grab it, save it. Returns its audit. |
|
Persist the audit, keyed |
|
Verify every PNG exists, is 1440x900, and is not near-uniform. |
|
|
|
Write |
Module Contents¶
- render.audit(page) Dict[str, list][source]¶
Inspect a laid-out page for the defects that invalidate a render.
elided labels — an ellipsis where the name should be;
clipped plain labels — text wider than the box drawing it;
visible scrollbars;
a layout whose minimum height exceeds the canvas, which means Qt squeezed something to make it fit.
- render.build_sheet(specs: Sequence[dict], theme: str = 'dark', cols: int = 5, thumb_w: int = 440) str[source]¶
Compose all thirty renders into one numbered grid. Returns the path.
- render.load_audit() Dict[Tuple[int, str], Dict[str, list]][source]¶
The cached audit, or an empty dict when there is none.
- render.measure_sidebar(app) Tuple[int, int][source]¶
(height the Sidebar's rows need, height a 1440x900 window gives).Measures the scrolled content, not the widget. The QScrollArea these renders argued for has since landed in
spacr.qt.app, soSidebar.layout().minimumSize()is now about 85 px — the height of a title over a collapsible viewport — and says nothing at all about whether the navigation fits. The number that still means something is how tall the rows inside the viewport are.
- render.render_all(app, specs: Sequence[dict], themes: Sequence[str]) Dict[Tuple[int, str], Dict[str, list]][source]¶
Render every (variant, theme) pair. Returns the audit per pair.
- render.render_one(app, spec: dict, theme: str, out_path: str) Dict[str, list][source]¶
Build one variant in one theme, grab it, save it. Returns its audit.
- render.save_audit(reports: Dict[Tuple[int, str], Dict[str, list]]) None[source]¶
Persist the audit, keyed
"<n>|<theme>"so it round-trips JSON.
- render.self_check(specs: Sequence[dict], themes: Sequence[str]) dict[source]¶
Verify every PNG exists, is 1440x900, and is not near-uniform.