common¶
Shared bootstrap + data for the Home-screen variant generators.
These modules render THIRTY candidate Home screens out of the real Qt
widgets (spacr.qt.widgets.tile.HTile, Card, Section, …) and
the real app registry (spacr.qt.app.APPS), then grab each one to a
PNG under spacr/resources/home/versions/.
Nothing here is installed into the app. It is a review surface: the user picks a layout, and because every layout is built from real widgets, whatever they pick is known-buildable.
Determinism¶
QT_QPA_PLATFORM=offscreenand a throwawayQSettingspath, so the renders do not depend on the reviewer’s saved theme / font scale.No live system state. Every “recent run”, disk figure and GPU number is a fixed literal in
MOCK— a home screen that renders differently every run cannot be reviewed.
Attributes¶
Classes¶
Per-theme rendering context: palette, stylesheet, icon cache. |
Functions¶
|
Every app key, in registry order. |
|
All keys sorted by display name. |
|
|
|
The real |
|
Themes to render: dark + light, plus space when the palette exists. |
|
One-line description of an app key. |
Create (or return) the offscreen QApplication, isolated + fonted. |
|
|
All keys, most-used first (see |
|
Today's five sections, straight out of |
|
Raise if a categorisation drops, duplicates or invents a key. |
|
The Core-pipeline app keys, in registry order. |
|
Absolute path of this |
|
How many apps the registry holds right now. |
|
Display name of an app key. |
|
Pinned keys first, then everything else by frequency. |
|
Absolute path of the spacr checkout root (five levels up). |
|
Absolute path of |
Module Contents¶
- class common.Ctx(app, theme: str)[source]¶
Per-theme rendering context: palette, stylesheet, icon cache.
- apply_theme(target=None) None[source]¶
Apply this theme, to
targetif given, else the application.QApplication.setStyleSheet re-polishes EVERY top-level widget. Inside pytest-qt the application is shared, so widgets belonging to other tests – including ones mid-teardown whose C++ side is already gone – get re-polished, and the process SEGFAULTS. That is what took the tests/qt suite down here, and it is the same trap the theme work hit with QApplication.topLevelWidgets().
A stylesheet set on a widget cascades to its children, so styling the root being rendered is equivalent for our purposes and touches nothing else. The application-wide path is used only when bootstrap() created the application, i.e. in the standalone generator.
- common.apps() List[Tuple[str, str, str, str]][source]¶
The real
(key, name, blurb, section)list, unmodified.
- common.available_themes() Tuple[str, Ellipsis][source]¶
Themes to render: dark + light, plus space when the palette exists.
spaceis another agent’s work-in-progress; this probes for it rather than depending on it.
- common.bootstrap()[source]¶
Create (or return) the offscreen QApplication, isolated + fonted.
Redirects
QSettingsat a temp directory before anything reads a preference, sopreferences.get_font_scale()(whichHTile/scaled_pxconsult) always answers 1.0 regardless of what the reviewer has saved.
- common.by_frequency() List[str][source]¶
All keys, most-used first (see
USE_COUNTS).
- common.cats_current() List[Tuple[str, List[str]]][source]¶
Today’s five sections, straight out of
spacr.qt.app.
- common.check_coverage(cats: Sequence[Tuple[str, Sequence[str]]]) None[source]¶
Raise if a categorisation drops, duplicates or invents a key.
- common.core_keys() List[str][source]¶
The Core-pipeline app keys, in registry order.
Read from
spacr.qt.app.SECTION_CORErather than compared against a typed section name. The section used to be called “Core pipeline”; it is now “Core”, and the two variants that filtered on the old string silently produced an empty list — variant 18, whose entire content is the core nine, rendered nine missing tiles, and variant 24 lost every Ctrl+N badge.
- common.n_apps() int[source]¶
How many apps the registry holds right now.
Every “N apps” the variants draw or write goes through here. The count used to be typed into two dozen strings as
29; the registry then grew Distributed Jobs, Classifier Evaluation and Run History and every one of those strings became a lie that no test could see, because a literal cannot disagree with itself.