@@ -68,8 +68,8 @@ def setup(self):
6868 self .shell = get_ipython ()
6969 self .kernel = self .shell .kernel
7070 self .shell_stream = getattr (self .kernel , "shell_stream" , None )
71- self .execute_request_handler = self .kernel .shell_handlers ["execute_request" ]
7271 # Keep a reference to the ipykernel execute_request function
72+ self .execute_request_handler = self .kernel .shell_handlers ["execute_request" ]
7373 self .current_request = None
7474 self .waiting_on_viewer = False
7575 self .results = {}
@@ -204,24 +204,7 @@ def _callback(self, *args, **kwargs):
204204 self .update_namespace ()
205205 self .create_task (self .execute_next_request )
206206
207- def find_view_object_names (self ):
208- from .viewer import Viewer
209- # Used to determine that all references to Viewer
210- # objects are ready before a cell is run
211- objs = self .viewers .viewer_objects
212- user_vars = [k for k in self .shell .user_ns .keys () if not k .startswith ('_' )]
213- for var in user_vars :
214- # Identify which variable the view object has been assigned to
215- value = self .shell .user_ns [var ]
216- if isinstance (value , Viewer ) and value .__str__ () in objs :
217- idx = objs .index (value .__str__ ())
218- self .viewers .set_name (objs [idx ], var )
219-
220207 def post_run_cell (self , response ):
221- # If a cell has been run and there are viewers with no variable
222- # associated with them check the user namespace to see if they have
223- # been added
208+ # Abort remaining cells on error in execution
224209 if response .error_in_exec is not None :
225210 self .abort_all = True
226- if self .viewers .not_named :
227- self .find_view_object_names ()
0 commit comments