Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / enamlx / replace-unicode-with-str.patch
blob52df6e9a50e68ea9537345b0f7054d5f8eab0ab4
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
6 ---
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 +++---
16 setup.py | 2 +-
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
23 @@ -6,7 +6,7 @@
24 Created on Aug 24, 2015
25 """
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())
37 + text = d_(Str())
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
45 @@ -7,7 +7,7 @@
46 """
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
67 @@ -7,7 +7,7 @@
68 import sys
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))
79 #: Tool tip
80 - tool_tip = d_(Unicode())
81 + tool_tip = d_(Str())
83 #: Status tip
84 - status_tip = d_(Unicode())
85 + status_tip = d_(Str())
87 # --------------------------------------------------------------------------
88 # Item interaction
89 @@ -919,7 +919,7 @@ class GraphicsTextItem(AbstractGraphicsShapeItem):
90 proxy = Typed(ProxyGraphicsTextItem)
92 #: Text
93 - text = d_(Unicode())
94 + text = d_(Str())
96 #: Font
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
102 @@ -8,7 +8,7 @@
103 import sys
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())
116 + title = d_(Str())
118 #: Name
119 - name = d_(Unicode())
120 + name = d_(Str())
122 #: Row in plot area
123 row = d_(Int(0))
124 @@ -89,10 +89,10 @@ class PlotItem(Control):
125 #: Show legend
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())
137 # H, V
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.
145 << autodoc-me >>
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):
165 typemap = {int:Int,
166 float:Float,
167 - unicode:Unicode,
168 + unicode:Str,
169 str:Str}
170 for name, member in obtype.members().iteritems():
171 if (not name.startswith('_')
172 @@ -263,14 +263,14 @@ class FooModel(Atom):
173 ham = Int(42)
174 first = Str('first')
175 last = Str('last')
176 - owner = Unicode('owner')
177 + owner = Str('owner')
178 time = Float(42.56)
179 click = Bool()
180 clack = Bool()
183 class BarModel(Atom):
184 - name = Unicode('name')
185 + name = Str('name')
186 trigger = Event()
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
193 @@ -5,7 +5,7 @@
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())
207 + name = d_(Str())
209 #: Optional description of the part
210 - description = d_(Unicode())
211 + description = d_(Str())
213 @property
214 def shapes(self):
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
219 @@ -2,7 +2,7 @@
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
233 import time
234 import random
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()
246 + last_name = Str()
248 - first_name = Unicode()
249 + first_name = Str()
251 age = Range(low=0)
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
257 @@ -1,5 +1,5 @@
258 import os
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()
269 + last_name = Str()
271 - first_name = Unicode()
272 + first_name = Str()
274 children = List(ForwardInstance(lambda:Person))