diff --git a/Cargo.lock b/Cargo.lock index 5cd262d..35a51b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -156,7 +156,7 @@ dependencies = [ [[package]] name = "pytv" -version = "0.3.2" +version = "0.3.3" dependencies = [ "clap", "regex", @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.33" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0623d197252096520c6f2a5e1171ee436e5af99a5d7caa2891e55e61950e6d9" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap", "itoa", @@ -250,9 +250,9 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.53" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 2b09e3f..cd88417 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "pytv" description = "Python Templated Verilog" repository = "https://github.com/autohdw/pytv" authors = ["Teddy van Jerry "] -version = "0.3.2" +version = "0.3.3" readme = "README.md" license = "GPL-3.0-or-later" keywords = ["verilog", "python", "template", "generation"] diff --git a/src/convert.rs b/src/convert.rs index 4b52b97..e99fd00 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -71,7 +71,7 @@ impl Convert { output = output.replace(ext.to_str().unwrap(), "v"); } output - }) + }).replace("\\", "/") } /// Generates the output Python file name based on the input file name and configuration. @@ -149,16 +149,19 @@ impl Convert { /// Runs the Python code to generate verilog. /// - /// The command `python3` should be available to call. + /// The command `python3` (`python` for Windows) should be available to call. pub fn run_python(&self) -> IoResult<()> { let py_file = self.output_python_file_name(); let v_file = self.output_file_name(); let v_file_f = std::fs::File::create(&v_file)?; - let output = std::process::Command::new("python3") + #[cfg(not(target_family = "windows"))] + let python_cmd = "python3"; + #[cfg(target_family = "windows")] + let python_cmd = "python"; + let output = std::process::Command::new(python_cmd) .arg(&py_file) .stdout(v_file_f) .output()?; - dbg!(&output); if !output.status.success() { return Err(std::io::Error::new( std::io::ErrorKind::Other, diff --git a/src/inst.rs b/src/inst.rs index 12a5572..bce6302 100644 --- a/src/inst.rs +++ b/src/inst.rs @@ -81,10 +81,6 @@ impl Convert { } fn print_inst(&self, stream: &mut W, inst_str: &str) -> Result<(), Box> { - print!( - "{}", - Self::apply_protected_inst_group_regex(inst_str).as_str() - ); let inst_map: serde_yaml::Value = serde_yaml::from_str(&self.apply_protected_verilog_regex( Self::apply_protected_inst_group_regex(inst_str).as_str(), diff --git a/src/main.rs b/src/main.rs index 1280525..f473a72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ use pytv::Convert; fn main() { let convert = Convert::from_args(); - println!("{:#?}", convert); convert .convert_to_file() .unwrap_or_else(|err| eprintln!("Error: {}", err));