Update of /cvsroot/openrpg/openrpg1/orpg/chat
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9631/orpg/chat
Modified Files:
Tag: BRANCH-1-7-1
chatwnd.py
Log Message:
Fixed a bug in the Unknown replacement for dice rolls
Index: chatwnd.py
===================================================================
RCS file: /cvsroot/openrpg/openrpg1/orpg/chat/chatwnd.py,v
retrieving revision 1.161
retrieving revision 1.161.2.1
diff -C2 -d -r1.161 -r1.161.2.1
*** chatwnd.py 11 Feb 2007 03:49:32 -0000 1.161
--- chatwnd.py 13 Mar 2007 23:12:38 -0000 1.161.2.1
***************
*** 2289,2307 ****
newstr = "0"
! reg = re.compile("(\?)(\{*[a-zA-Z ]*\}*)")
matches = reg.findall(s)
- dlg = wx.TextEntryDialog(self,"Replace '?' with", "Missing Value?")
for i in xrange(0,len(matches)):
dlg.SetValue('')
if matches[i][1] != '':
! dlg.SetTitle("Missing Value for " + matches[i][1])
if dlg.ShowModal() == wx.ID_OK:
newstr = dlg.GetValue()
if newstr == '':
newstr = '0'
! s = s.replace(matches[i][0], newstr, 1).replace(matches[i][1], '', 1)
! dlg.Destroy()
--- 2289,2307 ----
newstr = "0"
! reg = re.compile("(\?\{*)([a-zA-Z ]*)(\}*)")
matches = reg.findall(s)
for i in xrange(0,len(matches)):
+ dlg = wx.TextEntryDialog(self, matches[i][1] + "?", "Missing Value?")
dlg.SetValue('')
if matches[i][1] != '':
! dlg.SetTitle("Enter Value for " + matches[i][1])
if dlg.ShowModal() == wx.ID_OK:
newstr = dlg.GetValue()
if newstr == '':
newstr = '0'
! s = s.replace(matches[i][0], newstr, 1).replace(matches[i][1], '', 1).replace(matches[i][2], '', 1)
! dlg.Destroy()
|