From 3e4660aaba71027fe19681b67fcb294994d45f29 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 23 Jan 2019 11:34:07 -0500 Subject: [PATCH 1/2] FIX: Use trait_set instead of set --- apptools/preferences/preferences_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apptools/preferences/preferences_helper.py b/apptools/preferences/preferences_helper.py index fc2da5fee..60602b9f5 100644 --- a/apptools/preferences/preferences_helper.py +++ b/apptools/preferences/preferences_helper.py @@ -163,7 +163,7 @@ def _initialize(self, preferences, notify=False): value = self._get_value(trait_name, preferences.get(key)) traits_to_set[trait_name] = value - self.set(trait_change_notify=notify, **traits_to_set) + self.trait_set(trait_change_notify=notify, **traits_to_set) # Listen for changes to the node's preferences. preferences.add_preferences_listener( From c6de8f81b333094e88e46200344b3b46e54cbd56 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 24 Jan 2019 14:59:38 -0500 Subject: [PATCH 2/2] FIX: A few more --- apptools/preferences/preference_binding.py | 2 +- apptools/preferences/ui/widget_editor.py | 2 +- apptools/template/test/scatter_plot.py | 26 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apptools/preferences/preference_binding.py b/apptools/preferences/preference_binding.py index a575e9a72..7f0d8446c 100644 --- a/apptools/preferences/preference_binding.py +++ b/apptools/preferences/preference_binding.py @@ -139,7 +139,7 @@ def _set_trait(self, notify=True): trait_value = self._get_value(self.trait_name, value) traits = {self.trait_name : trait_value} - self.obj.set(trait_change_notify=notify, **traits) + self.obj.trait_set(trait_change_notify=notify, **traits) return diff --git a/apptools/preferences/ui/widget_editor.py b/apptools/preferences/ui/widget_editor.py index 7fc48f4c0..187cfed13 100644 --- a/apptools/preferences/ui/widget_editor.py +++ b/apptools/preferences/ui/widget_editor.py @@ -77,7 +77,7 @@ class WidgetEditor(EditorFactory): def __call__ (self, *args, **traits): """ Call the object. """ - return self.set(**traits) + return self.trait_set(**traits) ########################################################################### # 'EditorFactory' interface. diff --git a/apptools/template/test/scatter_plot.py b/apptools/template/test/scatter_plot.py index 910d5ed06..8534a0e82 100644 --- a/apptools/template/test/scatter_plot.py +++ b/apptools/template/test/scatter_plot.py @@ -183,19 +183,19 @@ def activate_template ( self ): # Create the plot: self.plot = plot = Plot( pd ) - plot.plot( ( 'index', 'value' ), - type = 'scatter', - index_sort = 'ascending', - marker = self.marker, - color = self.color, - outline_color = self.outline_color, - marker_size = self.marker_size, - line_width = self.line_width, - bgcolor = 'white' ) - plot.set( padding_left = 50, - padding_right = 0, - padding_top = 0, - padding_bottom = 20 ) + plot.plot( ( 'index', 'value' ), + type = 'scatter', + index_sort = 'ascending', + marker = self.marker, + color = self.color, + outline_color = self.outline_color, + marker_size = self.marker_size, + line_width = self.line_width, + bgcolor = 'white' ) + plot.trait_set( padding_left = 50, + padding_right = 0, + padding_top = 0, + padding_bottom = 20 ) # Attach some tools to the plot: plot.tools.append( PanTool( plot, constrain_key = 'shift' ) )