From 019a53cdaeb7cefb2d57e206d766ddc456820736 Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 3 Dec 2004 16:01:13 +0000 Subject: [PATCH] Need to make sure we set the nickeq function even if we're using an already created database. --- plugins/QuoteGrabs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/QuoteGrabs.py b/plugins/QuoteGrabs.py index ceb9d6841..8c8308289 100644 --- a/plugins/QuoteGrabs.py +++ b/plugins/QuoteGrabs.py @@ -106,14 +106,18 @@ class SqliteQuoteGrabsDB(object): 'use this plugin. Download it at ' \ '' filename = plugins.makeChannelFilename(self.filename, channel) + def p(s1, s2): + return int(ircutils.nickEqual(s1, s2)) if filename in self.dbs: return self.dbs[filename] if os.path.exists(filename): self.dbs[filename] = sqlite.connect(filename, converters={'bool': bool}) + self.dbs[filename].create_function('nickeq', 2, p) return self.dbs[filename] db = sqlite.connect(filename, converters={'bool': bool}) self.dbs[filename] = db + self.dbs[filename].create_function('nickeq', 2, p) cursor = db.cursor() cursor.execute("""CREATE TABLE quotegrabs ( id INTEGER PRIMARY KEY, @@ -123,9 +127,6 @@ class SqliteQuoteGrabsDB(object): added_at TIMESTAMP, quote TEXT );""") - def p(s1, s2): - return int(ircutils.nickEqual(s1, s2)) - db.create_function('nickeq', 2, p) db.commit() return db