Skip to main content

actr_cli/templates/python/
mod.rs

1pub mod echo;
2
3use super::{LangTemplate, ProjectTemplateName, TemplateContext};
4use crate::error::Result;
5use std::collections::HashMap;
6
7pub struct PythonTemplate;
8
9impl LangTemplate for PythonTemplate {
10    fn load_files(
11        &self,
12        template_name: ProjectTemplateName,
13        _context: &TemplateContext,
14    ) -> Result<HashMap<String, String>> {
15        let mut files = HashMap::new();
16
17        match template_name {
18            ProjectTemplateName::Echo => {
19                echo::load(&mut files)?;
20            }
21            ProjectTemplateName::Empty => {
22                return Err(crate::error::ActrCliError::Unsupported(
23                    "Empty template is not supported for Python yet".to_string(),
24                ));
25            }
26            ProjectTemplateName::DataStream => {
27                return Err(crate::error::ActrCliError::Unsupported(
28                    "DataStream template is not supported for Python yet".to_string(),
29                ));
30            }
31        }
32
33        Ok(files)
34    }
35}