Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chaco/plugin/workbench_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def new_window(self, name=None, title=None, is_image=False):
window=workbench.active_window,
)
new_win.data = self.data
new_win.get_container().data = self.data
new_win.container.data = self.data
new_win.session = self

if title is not None:
Expand Down
6 changes: 3 additions & 3 deletions chaco/shell/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def hold(state=None):

def curplot():
if session.active_window:
return session.active_window.get_container()
return session.active_window.container
else:
return None

Expand All @@ -283,11 +283,11 @@ def _do_plot_boilerplate(kwargs, image=False):
else:
figure()

cont = session.active_window.get_container()
cont = session.active_window.container

if not cont:
cont = Plot(session.data)
session.active_window.set_container(cont)
session.active_window.container = cont

existing_tools = [type(t) for t in (cont.tools + cont.overlays)]
if not PanTool in existing_tools:
Expand Down
20 changes: 10 additions & 10 deletions chaco/shell/plot_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ def __init__(
self.SetAutoLayout(True)
self.Show(True)

def get_container(self):
# This is a Python property because this is not a HasTraits subclass.
@property
def container(self):
return self.plot_window.component

def set_container(self, container):
@container.setter
def container(self, container):
self.plot_window.component = container

def iconize(self, iconize):
Expand All @@ -90,9 +93,6 @@ def raise_window(self):
def close(self):
self.Close()

# This is a Python property because this is not a HasTraits subclass.
container = property(get_container, set_container)

# ------------------------------------------------------------------------
# Private methods
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -183,10 +183,13 @@ def __init__(

self.show()

def get_container(self):
# This is a Python property because this is not a HasTraits subclass.
@property
def container(self):
return self.plot_window.component

def set_container(self, container):
@container.setter
def container(self, container):
self.plot_window.component = container

def iconize(self, iconize):
Expand All @@ -213,9 +216,6 @@ def raise_window(self):
"""Raises this window to the top of the window hierarchy."""
self.raise_()

# This is a Python property because this is not a HasTraits subclass.
container = property(get_container, set_container)

# ------------------------------------------------------------------------
# Private methods
# ------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions chaco/shell/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def new_window(self, name=None, title=None, is_image=False):
image_default_origin=self.prefs.image_default_origin,
)
new_win.data = self.data
new_win.get_container().data = self.data
new_win.container.data = self.data
new_win.session = self

if title is not None:
Expand Down Expand Up @@ -145,7 +145,7 @@ def _set_active_window(self, win):
def _colormap_changed(self):
plots = []
for w in self.windows:
container = w.get_container()
container = w.container
for vals in container.plots.values():
plots.extend(vals)
for p in plots:
Expand Down
5 changes: 2 additions & 3 deletions chaco/tests/test_speedups.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_selection(self):
def test_selection_range(self):
pass

def _get_func(self):
@property
def func(self):
return self.module.scatterplot_gather_points

func = property(_get_func)