X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29a41103aad2860742a6d71942c9b9e14fe4a79d..ab3db25392f3b3d283d2a8cf8dbd54997850de5d:/wxPython/wx/tools/XRCed/params.py diff --git a/wxPython/wx/tools/XRCed/params.py b/wxPython/wx/tools/XRCed/params.py index 1fdb088342..71a7414989 100644 --- a/wxPython/wx/tools/XRCed/params.py +++ b/wxPython/wx/tools/XRCed/params.py @@ -630,7 +630,7 @@ class ParamContent(PPanel): def GetValue(self): if self.textModified: # text has newer value try: - return eval(self.text.GetValue()) + return self.text.GetValue().split('|') except SyntaxError: wx.LogError('Syntax error in parameter value: ' + self.GetName()) return [] @@ -639,15 +639,15 @@ class ParamContent(PPanel): self.freeze = True if not value: value = [] self.value = value - self.text.SetValue(str(value)) # update text ctrl + if value: + repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value) + else: + repr_ = '' + self.text.SetValue(repr_) # update text ctrl self.freeze = False def OnButtonEdit(self, evt): if self.textModified: # text has newer value - try: - self.value = eval(self.text.GetValue()) - except SyntaxError: - wx.LogError('Syntax error in parameter value: ' + self.GetName()) - self.value = [] + self.value = self.GetValue() dlg = ContentDialog(self, self.value) if dlg.ShowModal() == wx.ID_OK: value = [] @@ -664,11 +664,7 @@ class ParamContentCheckList(ParamContent): ParamContent.__init__(self, parent, name) def OnButtonEdit(self, evt): if self.textModified: # text has newer value - try: - self.value = eval(self.text.GetValue()) - except SyntaxError: - wx.LogError('Syntax error in parameter value: ' + self.GetName()) - self.value = [] + self.value = self.GetValue() dlg = ContentCheckListDialog(self, self.value) if dlg.ShowModal() == wx.ID_OK: value = []