From 02b2eddd453b7ce940e74201ab5cf9c80d2b12d0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 13 Nov 2003 17:11:52 +0000 Subject: [PATCH] Multiple bugs that couldn't be tested while the dict.org server was down have now been tested, found, and eradicated. --- others/dictclient.py | 7 +------ plugins/Dict.py | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/others/dictclient.py b/others/dictclient.py index 63b87860e..30575ca58 100644 --- a/others/dictclient.py +++ b/others/dictclient.py @@ -23,12 +23,7 @@ version = '1.0' def dequote(s): """Will remove single or double quotes from the start and end of a string and return the result.""" - quotechars = "'\"" - while s and s[0] in quotechars: - s = s[1:] - while str and str[-1] in quotechars: - s = s[0:-1] - return s + return s.strip('\'"') def enquote(s): """This function will put a string in double quotes, properly diff --git a/plugins/Dict.py b/plugins/Dict.py index 98979bcd1..47ce8d1ac 100644 --- a/plugins/Dict.py +++ b/plugins/Dict.py @@ -85,7 +85,7 @@ class Dict(callbacks.Privmsg, plugins.Configurable): """ try: conn = dictclient.Connection(self.configurables.get('server')) - dbs = conf.getdbdescs() + dbs = conn.getdbdescs().keys() dbs.sort() irc.reply(msg, utils.commaAndify(dbs)) except socket.timeout: @@ -98,7 +98,7 @@ class Dict(callbacks.Privmsg, plugins.Configurable): """ try: conn = dictclient.Connection(self.configurables.get('server')) - dbs = conf.getdbdescs() + dbs = conn.getdbdescs().keys() irc.reply(msg, random.choice(dbs)) except socket.timeout: irc.error(msg, replyTimeout)