diff options
author | Sumanto Kar | 2025-06-22 13:49:35 +0530 |
---|---|---|
committer | GitHub | 2025-06-22 13:49:35 +0530 |
commit | 056ddd70be9179a5bf2f4f07833e947251f050ef (patch) | |
tree | 2ca75065bdbc9dc1661ac74eea503df63504c0c9 | |
parent | 199875cda6aa76cdce179d87faa443724180950e (diff) | |
download | eSim-056ddd70be9179a5bf2f4f07833e947251f050ef.tar.gz eSim-056ddd70be9179a5bf2f4f07833e947251f050ef.tar.bz2 eSim-056ddd70be9179a5bf2f4f07833e947251f050ef.zip |
File path fixes LtspiceLibConverter.py
-rw-r--r-- | src/converter/LtspiceLibConverter.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/converter/LtspiceLibConverter.py b/src/converter/LtspiceLibConverter.py index 83f0414e..2f652659 100644 --- a/src/converter/LtspiceLibConverter.py +++ b/src/converter/LtspiceLibConverter.py @@ -18,12 +18,20 @@ class LTspiceLibConverter: script_dir = os.path.dirname(os.path.abspath(__file__)) # Define the relative path to parser.py from the current script's directory - relative_parser_path = "LTSpiceToKiCadConverter/src/Ubuntu" + # Check the current operating system + if os.name == 'nt': # Windows + relative_parser_path = "LTSpiceToKiCadConverter/src/Windows" + else: + relative_parser_path = "LTSpiceToKiCadConverter/src/Ubuntu" + + # Construct the full path to libParser.py parser_path = os.path.join(script_dir, relative_parser_path) print(parser_path) - command = ["python3", "lib_LTspice2Kicad.py", file_path] + # Strip the .asy extension + file_path_no_ext = os.path.splitext(file_path)[0] + command = ["python3", "lib_LTspice2Kicad.py", file_path_no_ext] print("Running command:", " ".join(command), "in", parser_path) try: subprocess.run(command, check=True, cwd=parser_path) |