hopefully this will fix some encoding problems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e98e706227
commit
e484fddf08
@ -630,7 +630,7 @@ class ParamContent(PPanel):
|
|||||||
def GetValue(self):
|
def GetValue(self):
|
||||||
if self.textModified: # text has newer value
|
if self.textModified: # text has newer value
|
||||||
try:
|
try:
|
||||||
return eval(self.text.GetValue())
|
return self.text.GetValue().split('|')
|
||||||
except SyntaxError:
|
except SyntaxError:
|
||||||
wx.LogError('Syntax error in parameter value: ' + self.GetName())
|
wx.LogError('Syntax error in parameter value: ' + self.GetName())
|
||||||
return []
|
return []
|
||||||
@ -639,15 +639,12 @@ class ParamContent(PPanel):
|
|||||||
self.freeze = True
|
self.freeze = True
|
||||||
if not value: value = []
|
if not value: value = []
|
||||||
self.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
|
self.freeze = False
|
||||||
def OnButtonEdit(self, evt):
|
def OnButtonEdit(self, evt):
|
||||||
if self.textModified: # text has newer value
|
if self.textModified: # text has newer value
|
||||||
try:
|
self.value = self.GetValue()
|
||||||
self.value = eval(self.text.GetValue())
|
|
||||||
except SyntaxError:
|
|
||||||
wx.LogError('Syntax error in parameter value: ' + self.GetName())
|
|
||||||
self.value = []
|
|
||||||
dlg = ContentDialog(self, self.value)
|
dlg = ContentDialog(self, self.value)
|
||||||
if dlg.ShowModal() == wx.ID_OK:
|
if dlg.ShowModal() == wx.ID_OK:
|
||||||
value = []
|
value = []
|
||||||
@ -664,11 +661,7 @@ class ParamContentCheckList(ParamContent):
|
|||||||
ParamContent.__init__(self, parent, name)
|
ParamContent.__init__(self, parent, name)
|
||||||
def OnButtonEdit(self, evt):
|
def OnButtonEdit(self, evt):
|
||||||
if self.textModified: # text has newer value
|
if self.textModified: # text has newer value
|
||||||
try:
|
self.value = self.GetValue()
|
||||||
self.value = eval(self.text.GetValue())
|
|
||||||
except SyntaxError:
|
|
||||||
wx.LogError('Syntax error in parameter value: ' + self.GetName())
|
|
||||||
self.value = []
|
|
||||||
dlg = ContentCheckListDialog(self, self.value)
|
dlg = ContentCheckListDialog(self, self.value)
|
||||||
if dlg.ShowModal() == wx.ID_OK:
|
if dlg.ShowModal() == wx.ID_OK:
|
||||||
value = []
|
value = []
|
||||||
|
@ -90,7 +90,7 @@ class xxxParamContent(xxxNode):
|
|||||||
text = n.childNodes[0] # first child must be text node
|
text = n.childNodes[0] # first child must be text node
|
||||||
assert text.nodeType == minidom.Node.TEXT_NODE
|
assert text.nodeType == minidom.Node.TEXT_NODE
|
||||||
l.append(text)
|
l.append(text)
|
||||||
data.append(str(text.data))
|
data.append(text.data)
|
||||||
else: # remove other
|
else: # remove other
|
||||||
node.removeChild(n)
|
node.removeChild(n)
|
||||||
n.unlink()
|
n.unlink()
|
||||||
|
Loading…
Reference in New Issue
Block a user