exlab_wizard.readme#
README generation package. Backend Spec §10.
- class exlab_wizard.readme.CoreFields(label, operator, objective)[source]#
Bases:
objectMandatory core fields (User Interaction Spec §2).
All three are non-empty (after trim) when the controller hands the context to
ReadmeGenerator; the generator re-validates so a misuse never lets a malformed README onto disk.
- class exlab_wizard.readme.CustomField(label, value)[source]#
Bases:
objectAn ad-hoc user-added field. Backend Spec §10.4.
Custom fields are plain string key-value pairs (no type selection) and their order in the output mirrors the order the user added them.
- class exlab_wizard.readme.ReadmeContext(level, core, template_fields, config_fields, custom_fields, system, template_field_decls=<factory>, config_field_decls=<factory>)[source]#
Bases:
objectInputs to
ReadmeGenerator. Composed by the controller.The controller pre-merges the four layers into the dicts below so the generator does not need to know about the merge order; the generator’s job is to validate, render, and persist.
- Parameters:
level (
CreationLevel)core (
CoreFields)custom_fields (
list[CustomField])system (
SystemFields)template_field_decls (
list[TemplateFieldDecl])config_field_decls (
list[TemplateFieldDecl])
- config_field_decls: list[TemplateFieldDecl]#
- core: CoreFields#
- custom_fields: list[CustomField]#
- level: CreationLevel#
- system: SystemFields#
- template_field_decls: list[TemplateFieldDecl]#
- class exlab_wizard.readme.ReadmeGenerator[source]#
Bases:
objectRenders
README.md+readme_fields.json. Backend Spec §10.- async generate(dst, ctx)[source]#
Validate
ctx, write both files, return(readme, cache).The destination directory
dstmust already exist (the controller creates it during the directory-render phase). The.exlab-wizard/cache directory is created on demand.Both files are written via
asyncio.to_threadso the asyncio event loop is never blocked on disk syscalls. The two writes share a single timestamp (ctx.system.created) so thegenerated_atandcreatedfields agree.- Parameters:
dst (
Path)ctx (
ReadmeContext)
- Return type:
- class exlab_wizard.readme.SystemFields(created, created_by, equipment, template, project, run, run_kind)[source]#
Bases:
objectAuto-populated, non-editable system fields. Backend Spec §10.6.
- Parameters:
- class exlab_wizard.readme.TemplateFieldDecl(id, label, type, required=False, default='', options=None, hint=None)[source]#
Bases:
objectField declaration from a template’s
_exlab_readme.fieldslist or fromconfig.yamlreadme.defaults. Backend Spec §10.3.The same shape covers both layers: the controller knows which list it came from and packs the matching
ReadmeContextslot.- Parameters:
- type: FieldType#
Modules
README generator. |