equal
deleted
inserted
replaced
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 |
23 |
24 |
24 |
25 from __future__ import absolute_import |
25 from __future__ import absolute_import |
26 import re |
26 import re |
27 from types import TupleType |
|
28 |
27 |
29 import wx |
28 import wx |
30 |
29 |
31 from controls import CustomEditableListBox |
30 from controls import CustomEditableListBox |
32 |
31 |
33 # ------------------------------------------------------------------------------- |
32 # ------------------------------------------------------------------------------- |
34 # Helpers |
33 # Helpers |
35 # ------------------------------------------------------------------------------- |
34 # ------------------------------------------------------------------------------- |
36 |
35 |
37 DIMENSION_MODEL = re.compile("([0-9]+)\.\.([0-9]+)$") |
36 DIMENSION_MODEL = re.compile(r"([0-9]+)\.\.([0-9]+)$") |
38 |
37 |
39 # ------------------------------------------------------------------------------- |
38 # ------------------------------------------------------------------------------- |
40 # Array Type Dialog |
39 # Array Type Dialog |
41 # ------------------------------------------------------------------------------- |
40 # ------------------------------------------------------------------------------- |
42 |
41 |
81 self.SetSizer(main_sizer) |
80 self.SetSizer(main_sizer) |
82 |
81 |
83 for datatype in datatypes: |
82 for datatype in datatypes: |
84 self.BaseType.Append(datatype) |
83 self.BaseType.Append(datatype) |
85 |
84 |
86 if isinstance(infos, TupleType) and infos[0] == "array": |
85 if isinstance(infos, tuple) and infos[0] == "array": |
87 self.BaseType.SetStringSelection(infos[1]) |
86 self.BaseType.SetStringSelection(infos[1]) |
88 self.Dimensions.SetStrings(map("..".join, infos[2])) |
87 self.Dimensions.SetStrings(map("..".join, infos[2])) |
89 elif infos in datatypes: |
88 elif infos in datatypes: |
90 self.BaseType.SetStringSelection(infos) |
89 self.BaseType.SetStringSelection(infos) |
91 |
90 |