Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogoncalves03 committed Dec 9, 2024
1 parent e12d028 commit f2d3412
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run_shared/magic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import time
from string import Template
from typing import Any

from IPython.core.interactiveshell import InteractiveShell
Expand Down Expand Up @@ -29,7 +30,8 @@ def run_shared(self, line: str, local_ns: Any = None) -> Any:
%run_shared shared_file.ipynb
"""
shared_file = line.strip()
template = Template(line.strip())
shared_file = template.safe_substitute(local_ns)
if not shared_file:
raise ValueError('No shared file specified.')
if shared_file.startswith("'") and shared_file.endswith("'"):
Expand Down

0 comments on commit f2d3412

Please sign in to comment.