Skip to content

Commit

Permalink
Merge pull request #16 from maxfordham:🐛-fix-display-outputs-renderer
Browse files Browse the repository at this point in the history
updated so "outputs_show" works with relative paths
  • Loading branch information
jgunstone authored Jul 7, 2022
2 parents 59fa383 + 7cb1713 commit 0a1d7a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ipyrun/runshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def update_AutoDisplay(config, fn_onsave=None):
return functools.partial(AutoDisplay.from_paths, file_renderers=file_renderers)


def get_env(append_to_pythonpath: str):
def udpate_env(append_to_pythonpath: str):
env = os.environ.copy()
if not "PYTHONPATH" in env.keys():
env["PYTHONPATH"] = str(append_to_pythonpath)
Expand Down Expand Up @@ -425,7 +425,7 @@ def run_shell(app=None, display_hide_btn=True):
spinner = HaloNotebook(animation="marquee", text="Running", spinner="dots")
env = None
if app.config.pythonpath is not None:
env = get_env(app.config.pythonpath)
env = udpate_env(app.config.pythonpath)
try:
spinner.start()
save = sys.stdout
Expand All @@ -443,7 +443,6 @@ def run_shell(app=None, display_hide_btn=True):

class RunShellActions(DefaultRunActions):
"""extends RunActions by creating Callables based on data within the app or the config objects.
TODO: currently this full filepaths and does not work with relative paths. make it work with relative paths!
"""

config: DefaultConfigShell = None # not a config type is defined - get pydantic to validate it
Expand Down Expand Up @@ -506,9 +505,12 @@ def _inputs_show(cls, v, values):
def _outputs_show(cls, v, values):
if values["config"] is not None and values["app"] is not None:
AutoDisplayOutputs = update_AutoDisplay(values["config"])
paths = [
values["config"].fdir_root / f for f in values["config"].fpths_outputs
]
return functools.partial(
AutoDisplayOutputs,
values["config"].fpths_outputs,
paths,
**values["config"].autodisplay_outputs_kwargs,
)
else:
Expand Down

0 comments on commit 0a1d7a3

Please sign in to comment.