cutan.styles.copies¶
Copies of a style spec, and whether they are stale (cutan#19).
A spec changes between cutan releases (targets re-measured, roles re-cast), and
what a production copies out of it is a snapshot: the StylePack
(cutan.styles.style_pack()), a voice cast to one of the spec’s roles
(style_voice()), a kit’s members built from them. Each copy records where
it came from in metadata.style_spec = {name, sha256} (spec_origin()),
and an validate compares that digest with the installed spec’s
(check_style_copies()): a copy of an older spec is said, with what to
re-derive. A copy from a spec file, or one that records no digest, is never
compared (only a shipped spec has an installed version to compare with).
>>> spec_origin("south_park")["name"]
'south_park'
Module Attributes
Where a copy records the spec it came from, inside its |
Functions
|
|
|
|
|
Why |
|
The partial voice document |
- cutan.styles.copies.SPEC_ORIGIN_KEY: str = 'style_spec'¶
Where a copy records the spec it came from, inside its
metadata.
- cutan.styles.copies.check_style_copies(ctx)[source]¶
an validate: the style pack the scene names, and every voice its lines speak with, warn when they were copied from an older version of the shipped spec they record (cutan#19). Once per validation.- Return type:
- cutan.styles.copies.spec_origin(spec)[source]¶
{name, sha256}of the specspecnames (a shipped style’s name, a file), as a copy records it; nosha256for an in-memory mapping.
- cutan.styles.copies.stale_copy_problem(doc, *, what)[source]¶
Why
doc(a copy that recorded its spec) is stale, orNone: the shipped spec it names has changed since the copy was made.
- cutan.styles.copies.style_voice(spec, role)[source]¶
The partial voice document
speccastsroleas (an.audio.takes. style_voice_role: target names resolved to values), with the spec it came from recorded, so a later re-measure of the style is noticed. Merge it beside avoice_id:{**style_voice("oversimplified", "eager"), "voice_id": ...}.>>> doc = style_voice("oversimplified", "narrator") >>> doc["metadata"]["style_spec"]["name"], "targets" in doc["takes"]["cues"]["deadpan"] ('oversimplified', True)