make dice case-insensitive, improve remember.py:forget formatting

This commit is contained in:
Ryan Hitchman 2010-02-22 19:22:47 -07:00
parent 35d0444f13
commit cf4b7e50e5
2 changed files with 5 additions and 4 deletions

View File

@ -9,9 +9,10 @@ from util import hook
whitespace_re = re.compile(r'\s+')
valid_diceroll_re = re.compile(r'^[+-]?(\d+|\d*d\d+)([+-](\d+|\d*d\d+))*$')
sign_re = re.compile(r'[+-]?(?:\d*d)?\d+')
split_re = re.compile(r'([\d+-]*)d?(\d*)')
valid_diceroll_re = re.compile(r'^[+-]?(\d+|\d*d\d+)([+-](\d+|\d*d\d+))*$',
re.I)
sign_re = re.compile(r'[+-]?(?:\d*d)?\d+', re.I)
split_re = re.compile(r'([\d+-]*)d?(\d*)', re.I)
def nrolls(count, n):

View File

@ -53,7 +53,7 @@ def forget(inp, chan='', db=None):
db.execute("delete from memory where chan=? and word=lower(?)",
(chan, inp))
db.commit()
return 'forgot that %r' % data
return 'forgot that "%s"' % data.replace('"', "''")
else:
return "I don't know about that."