1 From 16df11227b8cee724624541d274e481802ea67e3 Mon Sep 17 00:00:00 2001
2 From: frmdstryr <frmdstryr@protonmail.com>
3 Date: Tue, 3 Nov 2020 21:41:52 -0500
4 Subject: [PATCH] Replace Unicode with Str
7 enamlx/widgets/abstract_item.py | 4 ++--
8 enamlx/widgets/console.py | 4 ++--
9 enamlx/widgets/graphics_view.py | 8 ++++----
10 enamlx/widgets/plot_area.py | 14 +++++++-------
11 examples/occ_viewer/advanced.enaml | 12 ++++++------
12 examples/occ_viewer/occ/part.py | 6 +++---
13 examples/plot_area/plot_area.enaml | 2 +-
14 examples/table_view/table_view.enaml | 6 +++---
15 examples/tree_view/tree_view.enaml | 6 +++---
17 10 files changed, 32 insertions(+), 32 deletions(-)
19 diff --git a/enamlx/widgets/abstract_item.py b/enamlx/widgets/abstract_item.py
20 index 29a3d87..67a5c6e 100644
21 --- a/enamlx/widgets/abstract_item.py
22 +++ b/enamlx/widgets/abstract_item.py
24 Created on Aug 24, 2015
26 from atom.api import (
27 - Int, Enum, Bool, Unicode, Typed,
28 + Int, Enum, Bool, Str, Typed,
29 Coerced, Event, Property, ForwardInstance, observe
31 from enaml.icon import Icon
32 @@ -96,7 +96,7 @@ class AbstractWidgetItem(AbstractWidgetItemGroup):
33 column = d_(Int(), writable=False)
35 #: Text to display within the cell
36 - text = d_(Unicode())
39 #: Text alignment within the cell
40 text_alignment = d_(Enum(*[(h, v)
41 diff --git a/enamlx/widgets/console.py b/enamlx/widgets/console.py
42 index bc61e90..2f1e981 100644
43 --- a/enamlx/widgets/console.py
44 +++ b/enamlx/widgets/console.py
48 from atom.api import (
49 - Instance, Coerced, Int, Enum, Unicode, Dict, Bool,
50 + Instance, Coerced, Int, Enum, Str, Dict, Bool,
51 Typed, ForwardTyped, observe
53 from enaml.core.api import d_
54 @@ -47,7 +47,7 @@ class Console(Container):
55 proxy = Typed(ProxyConsole)
57 #: Font family, leave blank for default
58 - font_family = d_(Unicode())
59 + font_family = d_(Str())
61 #: Font size, leave 0 for default
62 font_size = d_(Int(0))
63 diff --git a/enamlx/widgets/graphics_view.py b/enamlx/widgets/graphics_view.py
64 index f7e3e47..e672c63 100644
65 --- a/enamlx/widgets/graphics_view.py
66 +++ b/enamlx/widgets/graphics_view.py
69 from atom.api import (
70 Atom, Float, Int, Typed, Bool, Coerced, ForwardTyped, Enum, List, IntEnum,
71 - Instance, Unicode, Value, Event, Property, observe, set_default
72 + Instance, Str, Value, Event, Property, observe, set_default
74 from enaml.colors import ColorMember
75 from enaml.core.declarative import d_, d_func
76 @@ -419,10 +419,10 @@ class GraphicsItem(ToolkitObject, ConstrainableMixin):
77 visible = d_(Bool(True))
80 - tool_tip = d_(Unicode())
81 + tool_tip = d_(Str())
84 - status_tip = d_(Unicode())
85 + status_tip = d_(Str())
87 # --------------------------------------------------------------------------
89 @@ -919,7 +919,7 @@ class GraphicsTextItem(AbstractGraphicsShapeItem):
90 proxy = Typed(ProxyGraphicsTextItem)
93 - text = d_(Unicode())
97 font = d_(FontMember())
98 diff --git a/enamlx/widgets/plot_area.py b/enamlx/widgets/plot_area.py
99 index 5136693..383957b 100644
100 --- a/enamlx/widgets/plot_area.py
101 +++ b/enamlx/widgets/plot_area.py
104 from atom.atom import set_default
105 from atom.api import (Callable, Int, Tuple, Instance, Enum, Float,
106 - ContainerList, Bool, FloatRange, Unicode, Dict, Typed,
107 + ContainerList, Bool, FloatRange, Str, Dict, Typed,
108 ForwardTyped, observe)
109 from enaml.core.declarative import d_
110 from enaml.widgets.api import Container
111 @@ -41,10 +41,10 @@ class PlotArea(Container):
113 class PlotItem(Control):
114 #: Title of data series
115 - title = d_(Unicode())
119 - name = d_(Unicode())
124 @@ -89,10 +89,10 @@ class PlotItem(Control):
126 show_legend = d_(Bool(False))
128 - label_left = d_(Unicode())
129 - label_right = d_(Unicode())
130 - label_top = d_(Unicode())
131 - label_bottom = d_(Unicode())
132 + label_left = d_(Str())
133 + label_right = d_(Str())
134 + label_top = d_(Str())
135 + label_bottom = d_(Str())
138 grid = d_(Tuple(bool, default=(False, False)))
139 diff --git a/examples/occ_viewer/advanced.enaml b/examples/occ_viewer/advanced.enaml
140 index 872d44d..f1c48d5 100644
141 --- a/examples/occ_viewer/advanced.enaml
142 +++ b/examples/occ_viewer/advanced.enaml
143 @@ -15,7 +15,7 @@ is then used to unroll a list of these controls into the body of a form.
147 -from atom.api import Atom, Bool, Enum, Event, Float, Int, Str, Unicode
148 +from atom.api import Atom, Bool, Enum, Event, Float, Int, Str, Str
150 from enaml.core.api import DynamicTemplate
151 from enaml.stdlib.fields import FloatField
152 @@ -73,8 +73,8 @@ template FormControl(Attr, MemberType: Str):
153 text :: setattr(model, Attr, str(text))
156 -template FormControl(Attr, MemberType: Unicode):
157 - """ A form control template specialization for Unicode members.
158 +template FormControl(Attr, MemberType: Str):
159 + """ A form control template specialization for Str members.
161 This control uses a Field to represent the value.
163 @@ -174,7 +174,7 @@ def form_spec(obtype, model):
170 for name, member in obtype.members().iteritems():
171 if (not name.startswith('_')
172 @@ -263,14 +263,14 @@ class FooModel(Atom):
176 - owner = Unicode('owner')
177 + owner = Str('owner')
183 class BarModel(Atom):
184 - name = Unicode('name')
187 choices = Enum('first', 'second', 'third')
188 def _observe_trigger(self, change):
189 diff --git a/examples/occ_viewer/occ/part.py b/examples/occ_viewer/occ/part.py
190 index 1fe2b85..144354f 100644
191 --- a/examples/occ_viewer/occ/part.py
192 +++ b/examples/occ_viewer/occ/part.py
196 from atom.api import (
197 - Typed, ForwardTyped, Unicode
198 + Typed, ForwardTyped, Str
200 from enaml.core.declarative import d_
202 @@ -26,10 +26,10 @@ class Part(ToolkitObject):
203 proxy = Typed(ProxyPart)
205 #: Optional name of the part
206 - name = d_(Unicode())
209 #: Optional description of the part
210 - description = d_(Unicode())
211 + description = d_(Str())
215 diff --git a/examples/plot_area/plot_area.enaml b/examples/plot_area/plot_area.enaml
216 index 2085c8f..b5cd3c4 100644
217 --- a/examples/plot_area/plot_area.enaml
218 +++ b/examples/plot_area/plot_area.enaml
220 Demonstrating the examples from pyqtgraph
223 -from atom.api import (Atom, Unicode, Range, List, Bool)
224 +from atom.api import (Atom, Str, Range, List, Bool)
226 from enaml.widgets.api import (
227 Window, Container, DockArea,DockItem,PushButton, CheckBox, RadioButton
228 diff --git a/examples/table_view/table_view.enaml b/examples/table_view/table_view.enaml
229 index 6d7a35e..6fef544 100644
230 --- a/examples/table_view/table_view.enaml
231 +++ b/examples/table_view/table_view.enaml
232 @@ -2,7 +2,7 @@ import os
235 from threading import Thread
236 -from atom.api import (Atom, Unicode, Range, ContainerList, Bool)
237 +from atom.api import (Atom, Str, Range, ContainerList, Bool)
239 from enamlx.widgets.table_view import (
240 TableView, TableViewRow, TableViewItem
241 @@ -38,9 +38,9 @@ class Person(Atom):
242 """ A simple class representing a person object.
245 - last_name = Unicode()
248 - first_name = Unicode()
253 diff --git a/examples/tree_view/tree_view.enaml b/examples/tree_view/tree_view.enaml
254 index 37f991f..e88e1fd 100644
255 --- a/examples/tree_view/tree_view.enaml
256 +++ b/examples/tree_view/tree_view.enaml
259 -from atom.api import (Atom, Unicode, Range, List, Bool, ForwardInstance)
260 +from atom.api import (Atom, Str, Range, List, Bool, ForwardInstance)
262 from enamlx.widgets.api import (
263 TreeView, TreeViewItem, TreeViewColumn,
264 @@ -33,9 +33,9 @@ class Person(Atom):
265 """ A simple class representing a person object.
268 - last_name = Unicode()
271 - first_name = Unicode()
274 children = List(ForwardInstance(lambda:Person))