Skip to content

Migrate format_presets.py to spec + code generation #185

Open

Description

@rtibbles

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

format_presets should be generated from a spec in the format #182 introduces. Studio, Kolibri and ricecooker read its field names and list order, so its public Python API should not change.

Complexity: Medium
Target branch: main

Context

The Change

  • Where a preset's _READABLE constant and readable_name differ, the spec should hold both, so neither changes.
  • js/FormatPresets.js should export the constants as its default export and the preset records as a named export.

Acceptance Criteria

  • le_utils/constants/format_presets.py and js/FormatPresets.js are generated from spec/constants-format_presets.json, presetlookup.json is deleted, and make build on a clean checkout leaves no diff.
  • The pinned-API test from Add namedtuple spec support and migrate file_formats.py #182 passes unchanged for format_presets, including PRESETLIST order and RENDERABLE_PRESETS_ORDER.

AI usage

I made the decisions recorded on #181 and #182; Claude Code applied them to this module against the current code and drafted the issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions