summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-03-18 23:10:49 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-03-18 23:10:49 +0100
commitb547dffc74d666e5efacaf34b66f93ca7705bbd9 (patch)
tree46b342e0b79c1660116adc517149a7764ec74d72 /modules
parent86a11ce7fc0181291115bb73f0215652106c261f (diff)
anidb: Fixed database and sql statements.
Diffstat (limited to 'modules')
-rw-r--r--modules/anidb.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/anidb.py b/modules/anidb.py
index 5a3633d..9a4ba47 100644
--- a/modules/anidb.py
+++ b/modules/anidb.py
@@ -20,7 +20,7 @@ for option in ('username', 'password'):
class Module:
def __init__(self, bot):
self.irc = bot
- self.db = PgSQL.connect()
+ self.db = PgSQL.connect(database = 'fot')
def get_aid(self, msg, short = False):
if msg.isdigit():
@@ -32,9 +32,9 @@ class Module:
search = '%%%s%%' % search
cur = self.db.cursor()
if short:
- cur.execute('select * from anidb.anidb where aid in (select distinct aid from anidb.anidb where title ~~* %s and type in (2, 3)) and type = 1', (search,))
+ cur.execute('select * from anidb where aid in (select distinct aid from anidb where title ~~* %s and type in (2, 3)) and type = 1', (search,))
else:
- cur.execute('select * from anidb.anidb where aid in (select distinct aid from anidb.anidb where title ~~* %s) and type = 1', (search,))
+ cur.execute('select * from anidb where aid in (select distinct aid from anidb where title ~~* %s) and type = 1', (search,))
r = cur.fetchall()
cur.close()
return [(r[0][0], r[0][3])] if len(r) == 1 else [(x[0], x[3]) for x in r]