Skip to main content

azul_css/codegen/
python.rs

1//! Python backend stub. Returns a single placeholder source file noting that
2//! the emitter is not implemented; the dispatch path in [`super::backend_for`]
3//! is still wired so `?lang=python` produces a structured response instead of a
4//! 404.
5
6use alloc::{string::String, string::ToString, vec, vec::Vec};
7
8use super::{CodegenBackend, GeneratedFile};
9use crate::css::Css;
10
11pub struct PythonBackend;
12
13impl CodegenBackend for PythonBackend {
14    fn lang(&self) -> &'static str {
15        "python"
16    }
17
18    fn emit_css(&self, _css: &Css) -> String {
19        "# TODO: Python codegen backend not yet implemented.\n".to_string()
20    }
21
22    fn emit_project(&self, css: &Css) -> Vec<GeneratedFile> {
23        vec![GeneratedFile {
24            path: "main.py".to_string(),
25            contents: self.emit_css(css),
26        }]
27    }
28}