Made the error message better when people try to run a plugin that requires sqlite and they don't have it.

This commit is contained in:
Jeremy Fincher 2003-12-03 23:48:00 +00:00
parent 2aaca31709
commit 3398f1a819
16 changed files with 98 additions and 36 deletions

View File

@ -47,8 +47,6 @@ import getopt
import string
from itertools import imap, ifilter
import sqlite
import conf
import utils
import ircdb
@ -59,6 +57,13 @@ import ircutils
import callbacks
import configurable
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
smileys = (':)', ';)', ':]', ':-)', ':-D', ':D', ':P', ':p', '(=', '=)')
frowns = (':|', ':-/', ':-\\', ':\\', ':/', ':(', ':-(', ':\'(')

View File

@ -33,19 +33,24 @@
Add the module docstring here. This will be used by the setup.py script.
"""
import os
import conf
import time
import ircdb
import sqlite
__revision__ = "$Id$"
import plugins
import os
import time
import conf
import utils
import ircdb
import plugins
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
dbfilename = os.path.join(conf.dataDir, 'Dunno.db')
def configure(onStart, afterConnect, advanced):

View File

@ -44,8 +44,6 @@ import string
import os.path
from itertools import imap
import sqlite
import conf
import utils
import ircdb
@ -53,6 +51,12 @@ import ircutils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg):
def __init__(self):
plugins.ChannelDBHandler.__init__(self)

View File

@ -45,8 +45,6 @@ import string
import os.path
from itertools import imap
import sqlite
import conf
import ircdb
import utils
@ -57,6 +55,12 @@ import privmsgs
import callbacks
import configurable
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
tableCreateStatements = {
'larts': ("""CREATE TABLE larts (
id INTEGER PRIMARY KEY,

View File

@ -40,12 +40,16 @@ import plugins
import re
import os.path
import sqlite
import conf
import ircmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
dbfilename = os.path.join(conf.dataDir, 'Infobot.db')
def configure(onStart, afterConnect, advanced):

View File

@ -39,15 +39,17 @@ import os
import sets
from itertools import imap
import sqlite
import utils
import plugins
import privmsgs
import callbacks
import configurable
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and

View File

@ -43,13 +43,17 @@ import sys
import sets
import types
import sqlite
import conf
import utils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would

View File

@ -42,13 +42,16 @@ import plugins
import os.path
import sqlite
import ircmsgs
import ircutils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and

View File

@ -46,7 +46,6 @@ import time
import shlex
import string
import random
import sqlite
from itertools import imap
from cStringIO import StringIO
@ -60,6 +59,12 @@ import callbacks
import Owner
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
dbfilename = os.path.join(conf.dataDir, 'MoobotFactoids')
def configure(onStart, afterConnect, advanced):

View File

@ -41,14 +41,18 @@ import plugins
import os
import time
import sqlite
import conf
import ircdb
import utils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would

View File

@ -42,8 +42,6 @@ import time
import os.path
from itertools import imap
import sqlite
import conf
import utils
import ircdb
@ -53,6 +51,12 @@ import privmsgs
import ircutils
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
dbfilename = os.path.join(conf.dataDir, 'Notes.db')
class NoteDb(plugins.DBHandler):

View File

@ -41,8 +41,6 @@ import plugins
import os
import time
import sqlite
import conf
import utils
import ircdb
@ -50,6 +48,11 @@ import ircutils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and

View File

@ -45,8 +45,6 @@ import os
import time
import random
import sqlite
import conf
import utils
import ircmsgs
@ -56,6 +54,11 @@ import privmsgs
import callbacks
import configurable
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and

View File

@ -42,14 +42,18 @@ import time
import getopt
import os.path
import sqlite
import conf
import utils
import ircdb
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
class Quotes(plugins.ChannelDBHandler, callbacks.Privmsg):
def __init__(self):
plugins.ChannelDBHandler.__init__(self)

View File

@ -44,14 +44,18 @@ import getopt
import string
import os.path
import sqlite
import conf
import ircdb
import utils
import privmsgs
import callbacks
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
dbfilename = os.path.join(conf.dataDir, 'Todo.db')
def configure(onStart, afterConnect, advanced):

View File

@ -46,8 +46,6 @@ import getopt
import urllib2
import urlparse
import sqlite
import conf
import utils
import ircmsgs
@ -56,6 +54,12 @@ import privmsgs
import callbacks
import configurable
try:
import sqlite
except ImportError:
raise callbacks.Error, 'You need to have PySQLite installed to use this ' \
'plugin. Download it at <http://pysqlite.sf.net/>'
def configure(onStart, afterConnect, advanced):
# This will be called by setup.py to configure this module. onStart and
# afterConnect are both lists. Append to onStart the commands you would