From: Digital X. <dig...@us...> - 2007-03-13 23:11:43
|
Update of /cvsroot/openrpg/openrpg1/orpg/chat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9185/orpg/chat Modified Files: 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.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** chatwnd.py 27 Feb 2007 03:05:16 -0000 1.164 --- chatwnd.py 13 Mar 2007 23:11:42 -0000 1.165 *************** *** 2327,2345 **** 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() --- 2327,2345 ---- 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() |