Initial commit: University Playwright Codegen Agent
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
20
src/university_agent/writer.py
Normal file
20
src/university_agent/writer.py
Normal file
@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from .config import Settings
|
||||
from .models import ScriptPlan
|
||||
|
||||
|
||||
class ScriptWriter:
|
||||
"""Persist generated scripts to disk."""
|
||||
|
||||
def __init__(self, settings: Settings):
|
||||
self.settings = settings
|
||||
|
||||
def write(self, plan: ScriptPlan, script_body: str) -> Path:
|
||||
filename = plan.script_name or self.settings.default_script_name
|
||||
destination = self.settings.output_dir / filename
|
||||
destination.parent.mkdir(parents=True, exist_ok=True)
|
||||
destination.write_text(script_body, encoding="utf-8")
|
||||
return destination
|
||||
Reference in New Issue
Block a user