]> git.saurik.com Git - wxWidgets.git/commitdiff
hopefully this will fix some encoding problems
authorRoman Rolinsky <rolinsky@femagsoft.com>
Mon, 5 Jun 2006 16:01:42 +0000 (16:01 +0000)
committerRoman Rolinsky <rolinsky@femagsoft.com>
Mon, 5 Jun 2006 16:01:42 +0000 (16:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/tools/XRCed/params.py
wxPython/wx/tools/XRCed/xxx.py

index 1fdb0883425af4132cdbc3fc1ca6f094270accf4..c5f3f198e334bd1f31faedebb82bc8392c6b99f0 100644 (file)
@@ -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 = []
index e77d8fd6e8c8e1b3e5d3748cb96e208659b8ab59..53dde2f52c803a899f933005afd13d928a6aa9a5 100644 (file)
@@ -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()