Skip to content

Commit 3d3c8c8

Browse files
author
David Stirling
committed
Fix text-based groups
1 parent fc5b818 commit 3d3c8c8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

cpa/classifier.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ def SetupFetchFromGroupSizer(self, group):
20492049
validVals = list(set([col[i] for col in validKeys]))
20502050
validVals.sort()
20512051
validVals = [str(col) for col in validVals]
2052-
if group == 'image' or fieldTypes[i] == int or fieldTypes[i] == int:
2052+
if group == 'image' or fieldTypes[i] == int:
20532053
fieldInp = wx.TextCtrl(self.fetch_panel, -1, value=validVals[0], size=(80, -1))
20542054
fieldInp.SetSelection(-1,-1) # Fix #203, textCtrl has different API since wx3
20552055
else:
@@ -2133,9 +2133,10 @@ def GetGroupKeyFromGroupSizer(self, group=None):
21332133
fieldTypes = [int for input in self.groupInputs]
21342134
groupKey = []
21352135
for input, ftype in zip(self.groupInputs, fieldTypes):
2136-
# GetValue returns unicode from ComboBox, but we need a string
2137-
#val = str(input.GetStringSelection())
2138-
val = str(input.Value) # Fix issue #203
2136+
if isinstance(input, wx.TextCtrl):
2137+
val = input.GetValue()
2138+
else:
2139+
val = input.GetStringSelection()
21392140
# if the value is blank, don't bother typing it, it is a wildcard
21402141
if val != '__ANY__':
21412142
val = ftype(val)

0 commit comments

Comments
 (0)