Skip to content

Commit

Permalink
Do not run abaqus command at all if in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiliin committed Sep 17, 2022
1 parent 7cb509d commit e7ed5b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/abqpy/abaqus.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ def run(cae: bool = True) -> None:
filePath = str(filePath).replace(".ipynb", ".py")
except (FileNotFoundError, ImportError, Exception):
pass
if cae:
os.system(f"{abaqus} cae noGUI={filePath} -- {args}")
else:
os.system(f"{abaqus} python {filePath} {args}")


# check if in debug mode and run
debug = os.environ.get("ABQPY_DEBUG", "False").lower() == "true"
gettrace = getattr(sys, 'gettrace', None)
if not debug and gettrace is not None and gettrace():
debug = True
# if not in debug mode, exit the program

# If in debug mode do not run the abaqus command at all
if not debug:
if cae:
os.system(f"{abaqus} cae noGUI={filePath} -- {args}")
else:
os.system(f"{abaqus} python {filePath} {args}")
sys.exit(0)

0 comments on commit e7ed5b2

Please sign in to comment.