From b547dffc74d666e5efacaf34b66f93ca7705bbd9 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 18 Mar 2010 23:10:49 +0100 Subject: anidb: Fixed database and sql statements. --- modules/anidb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') 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] -- cgit v1.2.3