From 0db81708ddefdf17d2781170e9888dca241a11c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Gon=C3=A7alves?= Date: Mon, 9 Dec 2024 14:07:16 +0000 Subject: [PATCH] test --- run_shared/magic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_shared/magic.py b/run_shared/magic.py index 87949bde..99906a88 100644 --- a/run_shared/magic.py +++ b/run_shared/magic.py @@ -8,6 +8,7 @@ from IPython.core.magic import magics_class from IPython.core.magic import needs_local_scope from IPython.core.magic import no_var_expand +from jinja2 import Template @magics_class @@ -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.render(local_ns) if not shared_file: raise ValueError('No shared file specified.') if shared_file.startswith("'") and shared_file.endswith("'"):