Skip to content

Commit

Permalink
Set a shell attribute on OutputOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed May 29, 2017
1 parent 0476d94 commit 727431b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions holoviews/ipython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def __call__(self, *args, **params):
# Abort if IPython not found
try:
ip = params.pop('ip', None) or get_ipython() # noqa (get_ipython)
Store.output_options.shell = ip
except:
# Set current backend (usually has to wait until OutputOptions loaded)
Store.current_backend = selected_backend
Expand Down
4 changes: 3 additions & 1 deletion holoviews/ipython/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def missing_backend_exception(value, keyword, allowed):
nbagg_counter = 0

def __init__(self, *args, **kwargs):
self.shell = kwargs.pop('shell', None)
super(OutputOptions, self).__init__(*args, **kwargs)
self.output.__func__.__doc__ = self._generate_docstring()

Expand Down Expand Up @@ -376,7 +377,8 @@ def output(self, line, cell=None):
return

if cell is not None:
self.shell.run_cell(cell, store_history=STORE_HISTORY)
if self.shell:
self.shell.run_cell(cell, store_history=STORE_HISTORY)
# After cell magic restore previous options and restore
# temporarily selected renderer
OutputOptions.options = prev_restore
Expand Down

0 comments on commit 727431b

Please sign in to comment.