Skip to content

Commit 49463f2

Browse files
committed
Merge remote-tracking branch 'firemodels/master' into FireX
2 parents da65d2b + 6a17a7d commit 49463f2

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Utilities/Python/scripts/make_smv_images.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
# Make Smokeview images for the FDS Manuals.
3-
# The script uses the command "smokeview" unless you provide an optional name.
3+
# The script gets the smokeview executable appropriate for your OS from the smv repository
4+
# unless you provide an optional full path to the executable as an argument.
45

56
import pandas as pd
67
import os
@@ -10,9 +11,9 @@
1011
import argparse
1112

1213
parser = argparse.ArgumentParser(description="A script to generate Smokeview images")
13-
parser.add_argument("message", nargs="?", default="smokeview", help="Optional smokeview name")
14+
parser.add_argument("message", nargs="?", default="null", help="Optional smokeview path")
1415
args = parser.parse_args()
15-
shell_command = args.message
16+
smokeview_path = args.message
1617

1718
os_name = platform.system()
1819

@@ -21,6 +22,7 @@
2122
raise FileNotFoundError("xvfb-run is not installed. Please install xvfb package.")
2223

2324
bindir = '../../../smv/Build/for_bundle'
25+
smvdir = '../../../smv/Build/smokeview/'
2426
outdir = '../../Verification/'
2527
original_dir = os.getcwd()
2628

@@ -29,12 +31,14 @@
2931
folder = df[0].values
3032
case = df[1].values
3133

32-
if os_name == "Linux":
33-
result = subprocess.run(["bash", "-i", "-c", f"alias {shell_command} 2>/dev/null | sed -E \"s/alias {shell_command}='(.*)'/\\1/\""],
34-
capture_output=True, text=True)
35-
smokeview_path=result.stdout.strip()
36-
else:
37-
smokeview_path = shutil.which(shell_command)
34+
if smokeview_path != "null":
35+
print("Using "+smokeview_path)
36+
elif os_name == "Linux":
37+
smokeview_path = smvdir + 'intel_linux_64/smokeview_linux_64'
38+
elif os_name == "Darwin":
39+
smokeview_path = smvdir + 'gnu_osx_64/smokeview_osx_64'
40+
elif os_name == "Windows":
41+
smokeview_path = smvdir + 'intel_win_64/smokeview_win_64'
3842

3943
for i in range(len(folder)):
4044
print('generating smokeview image ' + case[i])

0 commit comments

Comments
 (0)