Now globs will actually be globbed

This commit is contained in:
James Vega 2003-12-11 00:27:01 +00:00
parent 318b9d5d19
commit 627dd87baf
2 changed files with 3 additions and 0 deletions

View File

@ -285,6 +285,8 @@ class Todo(callbacks.Privmsg):
predicateName += 'p'
for glob in rest:
criteria.append('task LIKE %s')
if '?' not in glob and '*' not in glob:
glob = '*%s*' % glob
formats.append(glob.translate(self._sqlTrans))
cursor = db.cursor()
sql = """SELECT id, task FROM todo WHERE %s""" % ' AND '.join(criteria)

View File

@ -107,6 +107,7 @@ if sqlite is not None:
def testSearchtodo(self):
self.assertNotError('todo add task number one')
self.assertRegexp('todo search task*', '#1: task number one')
self.assertRegexp('todo search number', '#1: task number one')
self.assertNotError('todo add task number two is much longer than'
' task number one')
self.assertRegexp('todo search task*',