Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Utilities/Python/scripts/make_smv_images.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

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

import pandas as pd
import os
Expand All @@ -10,9 +11,9 @@
import argparse

parser = argparse.ArgumentParser(description="A script to generate Smokeview images")
parser.add_argument("message", nargs="?", default="smokeview", help="Optional smokeview name")
parser.add_argument("message", nargs="?", default="null", help="Optional smokeview path")
args = parser.parse_args()
shell_command = args.message
smokeview_path = args.message

os_name = platform.system()

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

bindir = '../../../smv/Build/for_bundle'
smvdir = '../../../smv/Build/smokeview/'
outdir = '../../Verification/'
original_dir = os.getcwd()

Expand All @@ -29,12 +31,14 @@
folder = df[0].values
case = df[1].values

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

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