From 8954aa2d71c1be85d2bdb32a7dc89f2d51f3ce88 Mon Sep 17 00:00:00 2001 From: James Vega Date: Sun, 24 Oct 2004 01:14:27 +0000 Subject: [PATCH] I'm dumb --- plugins/Factoids.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/Factoids.py b/plugins/Factoids.py index 137fee11b..55ad49ba8 100644 --- a/plugins/Factoids.py +++ b/plugins/Factoids.py @@ -40,6 +40,7 @@ import string import os.path from itertools import imap +import supybot.dbi as dbi import supybot.conf as conf import supybot.utils as utils import supybot.ircdb as ircdb @@ -50,15 +51,6 @@ import supybot.privmsgs as privmsgs import supybot.registry as registry import supybot.callbacks as callbacks -import supybot.Owner as Owner - -try: - import sqlite -except ImportError: - raise callbacks.Error, 'You need to have PySQLite installed to use this ' \ - 'plugin. Download it at ' - - conf.registerPlugin('Factoids') conf.registerChannelValue(conf.supybot.plugins.Factoids, 'learnSeparator', @@ -260,6 +252,8 @@ class SqliteFactoidsDB(object): else: return cursor.fetchall() +FactoidsDB = plugins.DB('Factoids', {'sqlite': SqliteFactoidsDB}) + class Factoids(callbacks.Privmsg): def __init__(self): self.__parent = super(Factoids, self)