Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def on_close_view(sender, view_):
"""Unconnect all events when closing the view."""
if view_ == view:
unconnect(view.on_select)
unconnect(on_table_sort)
unconnect(on_table_filter)
unconnect(on_color_scheme_changed)
unconnect(on_cluster)
unconnect(on_add_view)
unconnect(on_ready)
def on_close_view(sender, view_):
if view == view_:
unconnect(on_toggle_spike_reorder)
unconnect(on_selected_channel_changed)
unconnect(on_select)
unconnect(on_time_range_selected)
def on_close(sender):
unconnect(on_add_view, self)
unconnect(on_view_ready, self)
unconnect(on_add_view_, self)
unconnect(on_select_more, self)
# Show save prompt if an action was done.
do_prompt_save = kwargs.get('do_prompt_save', True)
if do_prompt_save and self.supervisor.is_dirty(): # pragma: no cover
r = _prompt_save()
if r == 'save':
self.supervisor.save()
elif r == 'cancel':
# Prevent closing of the GUI by returning False.
return False
# Otherwise (r is 'close') we do nothing and close as usual.
def on_close_view(sender, view_):
if view == view_:
unconnect(on_selected_feature_changed)
unconnect(on_select)
def on_close_view(sender, view_):
"""Unconnect all events when closing the view."""
if view_ == view:
unconnect(view.on_select)
unconnect(on_table_sort)
unconnect(on_table_filter)
unconnect(on_color_scheme_changed)
unconnect(on_cluster)
unconnect(on_add_view)
unconnect(on_ready)
def on_close_view(sender, view_):
"""Unconnect all events when closing the view."""
if view_ == view:
unconnect(view.on_select)
unconnect(on_table_sort)
unconnect(on_table_filter)
unconnect(on_color_scheme_changed)
unconnect(on_cluster)
unconnect(on_add_view)
unconnect(on_ready)
def on_close_view(sender, view_):
if view == view_:
unconnect(on_toggle_spike_reorder)
unconnect(on_selected_channel_changed)
unconnect(on_select)
unconnect(on_time_range_selected)
def close(self):
"""Close the view."""
if hasattr(self, 'dock'):
return self.dock.close()
self.canvas.close()
self._closed = True
unconnect(self)
gc.collect(0)
def on_close_view(sender, view_):
"""Unconnect all events when closing the view."""
if view_ == view:
unconnect(view.on_select)
unconnect(on_table_sort)
unconnect(on_table_filter)
unconnect(on_color_scheme_changed)
unconnect(on_cluster)
unconnect(on_add_view)
unconnect(on_ready)