Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ temp_testing/*
build
dist
Issues/rule_keywords/test_DeleteMolecules_changed.bngl
.jules/
__pycache__/
19 changes: 15 additions & 4 deletions bionetgen/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,24 @@ def generate_notebook(app):
app.log.debug(f"Writing notebook to file: {fname}", f"{__file__} : notebook()")
notebook.write(fname)
# open the notebook with nbopen
# TODO: deal with stdout/err
app.log.debug(
f"Attempting to open notebook {fname} with nbopen",
f"{__file__} : notebook()",
)
stdout = getattr(subprocess, app.config["bionetgen"]["stdout"])
stderr = getattr(subprocess, app.config["bionetgen"]["stderr"])
try:
stdout_loc = getattr(subprocess, app.config["bionetgen"]["stdout"])
except (AttributeError, KeyError):
stdout_loc = subprocess.PIPE
try:
stderr_loc = getattr(subprocess, app.config["bionetgen"]["stderr"])
except (AttributeError, KeyError):
stderr_loc = subprocess.STDOUT

if args.open:
command = ["nbopen", fname]
rc, _ = run_command(command)
process = subprocess.Popen(
command,
stdout=stdout_loc,
stderr=stderr_loc,
)
rc = process.wait()
Loading