Skip to content

Commit 1f39f97

Browse files
committed
Allowing for directory specification
1 parent 7c1bd0a commit 1f39f97

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

openmc_plotter/__main__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22

3+
from argparse import ArgumentParser
34
from pathlib import Path
45
from threading import Thread
6+
import os
57
import signal
68
import sys
79

@@ -11,6 +13,16 @@
1113
from .main_window import MainWindow, _openmcReload
1214

1315
def main():
16+
ap = ArgumentParser(description='OpenMC Plotter GUI')
17+
ap.add_argument('-d','--model-directory', default=None,
18+
help='Location of model dir (default is current dir)')
19+
20+
args = ap.parse_args()
21+
22+
if args.model_directory is not None:
23+
os.chdir(args.model_directory)
24+
25+
def run_app():
1426
path_icon = str(Path(__file__).parent / 'assets/openmc_logo.png')
1527
path_splash = str(Path(__file__).parent / 'assets/splash.png')
1628

0 commit comments

Comments
 (0)