Skip to content

Commit

Permalink
shell true
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Jun 12, 2024
1 parent ad44557 commit f544168
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions ceasiompy/PyAVL/avlrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,8 @@ def run_avl(cpacs_path, wkdir):
subprocess.run(["xvfb-run", "avl"], stdin=open(str(command_path), "r"), cwd=case_dir_path)

if save_fig:
conversion_command = ["ps2pdf", "plot.ps", "plot.pdf"]
file_path = "command.txt"

command_str = " ".join(conversion_command)

with open(file_path, "w") as file:
file.write(command_str)
subprocess.run(conversion_command, cwd=case_dir_path, start_new_session=False)

delete_ps = ["rm", "plot.ps"]
file_path_2 = "delete_command.txt"

command_str_2 = " ".join(delete_ps)

with open(file_path_2, "w") as file:
file.write(command_str_2)

subprocess.run(delete_ps, cwd=case_dir_path, start_new_session=False)
subprocess.call(["ps2pdf", "plot.ps", "plot.pdf"], cwd=case_dir_path, shell=True)
subprocess.call(["rm", "plot.ps"], cwd=case_dir_path, shell=True)


# =================================================================================================
Expand Down

0 comments on commit f544168

Please sign in to comment.