|
1 | 1 |
|
2 | 2 | # 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. |
4 | 5 |
|
5 | 6 | import pandas as pd |
6 | 7 | import os |
|
10 | 11 | import argparse |
11 | 12 |
|
12 | 13 | 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") |
14 | 15 | args = parser.parse_args() |
15 | | -shell_command = args.message |
| 16 | +smokeview_path = args.message |
16 | 17 |
|
17 | 18 | os_name = platform.system() |
18 | 19 |
|
|
21 | 22 | raise FileNotFoundError("xvfb-run is not installed. Please install xvfb package.") |
22 | 23 |
|
23 | 24 | bindir = '../../../smv/Build/for_bundle' |
| 25 | +smvdir = '../../../smv/Build/smokeview/' |
24 | 26 | outdir = '../../Verification/' |
25 | 27 | original_dir = os.getcwd() |
26 | 28 |
|
|
29 | 31 | folder = df[0].values |
30 | 32 | case = df[1].values |
31 | 33 |
|
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' |
38 | 42 |
|
39 | 43 | for i in range(len(folder)): |
40 | 44 | print('generating smokeview image ' + case[i]) |
|
0 commit comments