Change json structure and add comments for modules

This commit is contained in:
mysty
2023-10-18 11:29:37 +01:00
parent 0a86db6b40
commit 7bf035aaf6
12 changed files with 85 additions and 48 deletions

View File

@@ -14,8 +14,12 @@ impl FileBuilder for PythonFileBuilder {
Ok(())
}
fn write_namespace(&mut self, output: &mut dyn Write, name: &str) -> Result<()> {
write!(output, "class {}:\n", name)?;
fn write_namespace(&mut self, output: &mut dyn Write, name: &str, comment: Option<&str>) -> Result<()> {
if let Some(comment) = comment {
write!(output, "class {}: # {}\n", name, comment)?;
} else {
write!(output, "class {}:\n", name)?;
}
Ok(())
}