From: Roman Rolinsky Date: Mon, 5 Jun 2006 16:01:42 +0000 (+0000) Subject: hopefully this will fix some encoding problems X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e484fddf08d62b205947eec9f071c7e68d0d1741 hopefully this will fix some encoding problems git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/tools/XRCed/params.py b/wxPython/wx/tools/XRCed/params.py index 1fdb088342..c5f3f198e3 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,12 @@ class ParamContent(PPanel): self.freeze = True if not value: value = [] self.value = value - self.text.SetValue(str(value)) # update text ctrl + repr_ = reduce(lambda a,b: '%s|%s' % (a,b), value) + 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 +661,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 = [] diff --git a/wxPython/wx/tools/XRCed/xxx.py b/wxPython/wx/tools/XRCed/xxx.py index e77d8fd6e8..53dde2f52c 100644 --- a/wxPython/wx/tools/XRCed/xxx.py +++ b/wxPython/wx/tools/XRCed/xxx.py @@ -90,7 +90,7 @@ class xxxParamContent(xxxNode): text = n.childNodes[0] # first child must be text node assert text.nodeType == minidom.Node.TEXT_NODE l.append(text) - data.append(str(text.data)) + data.append(text.data) else: # remove other node.removeChild(n) n.unlink()