aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/enamlx/replace-unicode-with-str.patch
blob: 52df6e9a50e68ea9537345b0f7054d5f8eab0ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
From 16df11227b8cee724624541d274e481802ea67e3 Mon Sep 17 00:00:00 2001
From: frmdstryr <frmdstryr@protonmail.com>
Date: Tue, 3 Nov 2020 21:41:52 -0500
Subject: [PATCH] Replace Unicode with Str

---
 enamlx/widgets/abstract_item.py      |  4 ++--
 enamlx/widgets/console.py            |  4 ++--
 enamlx/widgets/graphics_view.py      |  8 ++++----
 enamlx/widgets/plot_area.py          | 14 +++++++-------
 examples/occ_viewer/advanced.enaml   | 12 ++++++------
 examples/occ_viewer/occ/part.py      |  6 +++---
 examples/plot_area/plot_area.enaml   |  2 +-
 examples/table_view/table_view.enaml |  6 +++---
 examples/tree_view/tree_view.enaml   |  6 +++---
 setup.py                             |  2 +-
 10 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/enamlx/widgets/abstract_item.py b/enamlx/widgets/abstract_item.py
index 29a3d87..67a5c6e 100644
--- a/enamlx/widgets/abstract_item.py
+++ b/enamlx/widgets/abstract_item.py
@@ -6,7 +6,7 @@
 Created on Aug 24, 2015
 """
 from atom.api import (
-    Int, Enum, Bool, Unicode, Typed, 
+    Int, Enum, Bool, Str, Typed, 
     Coerced, Event, Property, ForwardInstance, observe
 )
 from enaml.icon import Icon
@@ -96,7 +96,7 @@ class AbstractWidgetItem(AbstractWidgetItemGroup):
     column = d_(Int(), writable=False)
     
     #: Text to display within the cell
-    text = d_(Unicode())
+    text = d_(Str())
     
     #: Text alignment within the cell
     text_alignment = d_(Enum(*[(h, v)
diff --git a/enamlx/widgets/console.py b/enamlx/widgets/console.py
index bc61e90..2f1e981 100644
--- a/enamlx/widgets/console.py
+++ b/enamlx/widgets/console.py
@@ -7,7 +7,7 @@
 """
 
 from atom.api import (
-    Instance, Coerced, Int, Enum, Unicode, Dict, Bool,
+    Instance, Coerced, Int, Enum, Str, Dict, Bool,
     Typed, ForwardTyped, observe
 )
 from enaml.core.api import d_
@@ -47,7 +47,7 @@ class Console(Container):
     proxy = Typed(ProxyConsole)
     
     #: Font family, leave blank for default
-    font_family = d_(Unicode())
+    font_family = d_(Str())
     
     #: Font size, leave 0 for default
     font_size = d_(Int(0))
diff --git a/enamlx/widgets/graphics_view.py b/enamlx/widgets/graphics_view.py
index f7e3e47..e672c63 100644
--- a/enamlx/widgets/graphics_view.py
+++ b/enamlx/widgets/graphics_view.py
@@ -7,7 +7,7 @@
 import sys
 from atom.api import (
     Atom, Float, Int, Typed, Bool, Coerced, ForwardTyped, Enum, List, IntEnum,
-    Instance, Unicode, Value, Event, Property, observe, set_default
+    Instance, Str, Value, Event, Property, observe, set_default
 )
 from enaml.colors import ColorMember
 from enaml.core.declarative import d_, d_func
@@ -419,10 +419,10 @@ class GraphicsItem(ToolkitObject, ConstrainableMixin):
     visible = d_(Bool(True))
     
     #: Tool tip
-    tool_tip = d_(Unicode())
+    tool_tip = d_(Str())
     
     #: Status tip
-    status_tip = d_(Unicode())
+    status_tip = d_(Str())
     
     # --------------------------------------------------------------------------
     # Item interaction
@@ -919,7 +919,7 @@ class GraphicsTextItem(AbstractGraphicsShapeItem):
     proxy = Typed(ProxyGraphicsTextItem)
     
     #: Text
-    text = d_(Unicode())
+    text = d_(Str())
     
     #: Font
     font = d_(FontMember())
diff --git a/enamlx/widgets/plot_area.py b/enamlx/widgets/plot_area.py
index 5136693..383957b 100644
--- a/enamlx/widgets/plot_area.py
+++ b/enamlx/widgets/plot_area.py
@@ -8,7 +8,7 @@
 import sys
 from atom.atom import set_default
 from atom.api import (Callable, Int, Tuple, Instance, Enum, Float,
-                      ContainerList, Bool, FloatRange, Unicode, Dict, Typed,
+                      ContainerList, Bool, FloatRange, Str, Dict, Typed,
                       ForwardTyped, observe)
 from enaml.core.declarative import d_
 from enaml.widgets.api import Container
@@ -41,10 +41,10 @@ class PlotArea(Container):
 
 class PlotItem(Control):
     #: Title of data series
-    title = d_(Unicode())
+    title = d_(Str())
 
     #: Name
-    name = d_(Unicode())
+    name = d_(Str())
 
     #: Row in plot area
     row = d_(Int(0))
@@ -89,10 +89,10 @@ class PlotItem(Control):
     #: Show legend
     show_legend = d_(Bool(False))
 
-    label_left = d_(Unicode())
-    label_right = d_(Unicode())
-    label_top = d_(Unicode())
-    label_bottom = d_(Unicode())
+    label_left = d_(Str())
+    label_right = d_(Str())
+    label_top = d_(Str())
+    label_bottom = d_(Str())
 
     # H, V
     grid = d_(Tuple(bool, default=(False, False)))
diff --git a/examples/occ_viewer/advanced.enaml b/examples/occ_viewer/advanced.enaml
index 872d44d..f1c48d5 100644
--- a/examples/occ_viewer/advanced.enaml
+++ b/examples/occ_viewer/advanced.enaml
@@ -15,7 +15,7 @@ is then used to unroll a list of these controls into the body of a form.
 
 << autodoc-me >>
 """
-from atom.api import Atom, Bool, Enum, Event, Float, Int, Str, Unicode
+from atom.api import Atom, Bool, Enum, Event, Float, Int, Str, Str
 
 from enaml.core.api import DynamicTemplate
 from enaml.stdlib.fields import FloatField
@@ -73,8 +73,8 @@ template FormControl(Attr, MemberType: Str):
         text :: setattr(model, Attr, str(text))
 
 
-template FormControl(Attr, MemberType: Unicode):
-    """ A form control template specialization for Unicode members.
+template FormControl(Attr, MemberType: Str):
+    """ A form control template specialization for Str members.
 
     This control uses a Field to represent the value.
 
@@ -174,7 +174,7 @@ def form_spec(obtype, model):
     
     typemap = {int:Int,
                float:Float,
-               unicode:Unicode,
+               unicode:Str,
                str:Str}
     for name, member in obtype.members().iteritems():
         if (not name.startswith('_') 
@@ -263,14 +263,14 @@ class FooModel(Atom):
     ham = Int(42)
     first = Str('first')
     last = Str('last')
-    owner = Unicode('owner')
+    owner = Str('owner')
     time = Float(42.56)
     click = Bool()
     clack = Bool()
 
 
 class BarModel(Atom):
-    name = Unicode('name')
+    name = Str('name')
     trigger = Event()
     choices = Enum('first', 'second', 'third')
     def _observe_trigger(self, change):
diff --git a/examples/occ_viewer/occ/part.py b/examples/occ_viewer/occ/part.py
index 1fe2b85..144354f 100644
--- a/examples/occ_viewer/occ/part.py
+++ b/examples/occ_viewer/occ/part.py
@@ -5,7 +5,7 @@
 '''
 
 from atom.api import (
-    Typed, ForwardTyped, Unicode
+    Typed, ForwardTyped, Str
 )
 from enaml.core.declarative import d_
 
@@ -26,10 +26,10 @@ class Part(ToolkitObject):
     proxy = Typed(ProxyPart)
     
     #: Optional name of the part
-    name = d_(Unicode())
+    name = d_(Str())
     
     #: Optional description of the part
-    description = d_(Unicode())
+    description = d_(Str())
     
     @property
     def shapes(self):
diff --git a/examples/plot_area/plot_area.enaml b/examples/plot_area/plot_area.enaml
index 2085c8f..b5cd3c4 100644
--- a/examples/plot_area/plot_area.enaml
+++ b/examples/plot_area/plot_area.enaml
@@ -2,7 +2,7 @@
 Demonstrating the examples from pyqtgraph
 """
 
-from atom.api import (Atom, Unicode, Range, List, Bool)
+from atom.api import (Atom, Str, Range, List, Bool)
 
 from enaml.widgets.api import (
     Window, Container, DockArea,DockItem,PushButton, CheckBox, RadioButton
diff --git a/examples/table_view/table_view.enaml b/examples/table_view/table_view.enaml
index 6d7a35e..6fef544 100644
--- a/examples/table_view/table_view.enaml
+++ b/examples/table_view/table_view.enaml
@@ -2,7 +2,7 @@ import os
 import time
 import random
 from threading import Thread
-from atom.api import (Atom, Unicode, Range, ContainerList, Bool)
+from atom.api import (Atom, Str, Range, ContainerList, Bool)
 
 from enamlx.widgets.table_view import (
     TableView, TableViewRow, TableViewItem
@@ -38,9 +38,9 @@ class Person(Atom):
     """ A simple class representing a person object.
 
     """
-    last_name = Unicode()
+    last_name = Str()
 
-    first_name = Unicode()
+    first_name = Str()
 
     age = Range(low=0)
 
diff --git a/examples/tree_view/tree_view.enaml b/examples/tree_view/tree_view.enaml
index 37f991f..e88e1fd 100644
--- a/examples/tree_view/tree_view.enaml
+++ b/examples/tree_view/tree_view.enaml
@@ -1,5 +1,5 @@
 import os
-from atom.api import (Atom, Unicode, Range, List, Bool, ForwardInstance)
+from atom.api import (Atom, Str, Range, List, Bool, ForwardInstance)
 
 from enamlx.widgets.api import (
     TreeView, TreeViewItem, TreeViewColumn, 
@@ -33,9 +33,9 @@ class Person(Atom):
     """ A simple class representing a person object.
 
     """
-    last_name = Unicode()
+    last_name = Str()
 
-    first_name = Unicode()
+    first_name = Str()
     
     children = List(ForwardInstance(lambda:Person))