Skip to main content

azul_css/codegen/
python.rs

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